Skip to content

[skip changelog] Run CI workflows that are useful to contributors on pushes to any branch #887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/link-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Verifies documentation links

on:
push:
branches:
- master
pull_request:
schedule:
- cron: "0 3 * * 1" # Every Monday at 03:00
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
name: docs
name: publish-docs

on:
pull_request:
paths:
# existing docs
- "docs/**"
# changes to the cli reference generator
- "docsgen/**"
# potential changes to commands documentation
- "cli/**"
# potential changes to gRPC documentation
- "rpc/**"
# changes to the workflow itself
- ".github/workflows/docs.yaml"
push:
branches:
- master
Expand All @@ -24,10 +12,10 @@ on:
- "docsgen/**"
- "cli/**"
- "rpc/**"
- ".github/workflows/docs.yaml"
- ".github/workflows/publish-docs.yaml"

jobs:
build:
publish:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -73,17 +61,10 @@ jobs:
python3 -m pip install --upgrade pip
python3 -m pip install -r ./requirements_docs.txt

- name: Build docs website
# This runs on every PR to ensure the docs build is sane, these docs
# won't be published
if: github.event_name == 'pull_request'
run: task docs:build

- name: Publish docs
# Determine docs version for the commit pushed and publish accordingly using Mike.
# Publishing implies creating a git commit on the gh-pages branch, we let
# ArduinoBot own these commits.
if: github.event_name == 'push'
run: |
git config --global user.email "[email protected]"
git config --global user.name "ArduinoBot"
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/python-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: "Lints Python code"

on:
push:
branches:
- master
paths:
- "**.py"
- ".flake8"
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: test

on:
push:
branches:
- master
pull_request:

jobs:
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/validate-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: validate-docs

on:
pull_request:
paths:
# existing docs
- "docs/**"
# changes to the cli reference generator
- "docsgen/**"
# potential changes to commands documentation
- "cli/**"
# potential changes to gRPC documentation
- "rpc/**"
# changes to the workflow itself
- ".github/workflows/validate-docs.yaml"
push:
# At this day, GitHub doesn't support YAML anchors, d'oh!
paths:
- "docs/**"
- "docsgen/**"
- "cli/**"
- "rpc/**"
- ".github/workflows/validate-docs.yaml"

jobs:
validate:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Taskfile
uses: Arduino/actions/setup-taskfile@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Go
uses: actions/setup-go@v2-beta
with:
go-version: "1.14"

- name: Install Go dependencies
run: |
go version
go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc

- name: Install protoc compiler
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: "3.6"
architecture: "x64"

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r ./requirements_docs.txt

- name: Build docs website
# Ensure the docs build is sane, these docs won't be published
run: task docs:build