Unverified Commit 466c8c2f authored by per1234's avatar per1234 Committed by GitHub

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

* Split docs workflow into validate and publish workflows

The docs workflow had two uses:

- Check that changes to docs don't break the static website build system
- Publish the docs to the website

To make the CI system friendly to contributors, it should be easy for them to validate documentation changes from a feature branch, meaning the validation aspect should run on a push to any branch. However, the special behavior of the workflow to publish on pushes conflicted with that usage. The most simple solution is to split the workflow into two. The validation workflow contains the process of interest to contributors, and is thus made friendly to their development process. The publishing workflow is not of interest to contributors, and thus doesn't need to be configured to run on pushes to any branch.

* Run workflows that are useful to contributors on push to any branch

Contributors should run CI in their feature branch to make sure it's passing before submitting a PR. Previously, the CI workflows were configured to run only on push to the master branch, meaning that contributors would need to modify the workflows just to get them to run on a feature branch. It's very unlikely that a contributor would do that, so they are more likely to just submit the PR, then if CI on the PR fails push fixup commits until CI is passing.

The solution is simply to remove the filters that caused the workflows to run only on push to master.
parent 67b47b66
...@@ -2,8 +2,6 @@ name: Verifies documentation links ...@@ -2,8 +2,6 @@ name: Verifies documentation links
on: on:
push: push:
branches:
- master
pull_request: pull_request:
schedule: schedule:
- cron: "0 3 * * 1" # Every Monday at 03:00 - cron: "0 3 * * 1" # Every Monday at 03:00
......
name: docs name: publish-docs
on: 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: push:
branches: branches:
- master - master
...@@ -24,10 +12,10 @@ on: ...@@ -24,10 +12,10 @@ on:
- "docsgen/**" - "docsgen/**"
- "cli/**" - "cli/**"
- "rpc/**" - "rpc/**"
- ".github/workflows/docs.yaml" - ".github/workflows/publish-docs.yaml"
jobs: jobs:
build: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
...@@ -73,17 +61,10 @@ jobs: ...@@ -73,17 +61,10 @@ jobs:
python3 -m pip install --upgrade pip python3 -m pip install --upgrade pip
python3 -m pip install -r ./requirements_docs.txt 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 - name: Publish docs
# Determine docs version for the commit pushed and publish accordingly using Mike. # 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 # Publishing implies creating a git commit on the gh-pages branch, we let
# ArduinoBot own these commits. # ArduinoBot own these commits.
if: github.event_name == 'push'
run: | run: |
git config --global user.email "bot@arduino.cc" git config --global user.email "bot@arduino.cc"
git config --global user.name "ArduinoBot" git config --global user.name "ArduinoBot"
......
...@@ -2,8 +2,6 @@ name: "Lints Python code" ...@@ -2,8 +2,6 @@ name: "Lints Python code"
on: on:
push: push:
branches:
- master
paths: paths:
- "**.py" - "**.py"
- ".flake8" - ".flake8"
......
...@@ -2,8 +2,6 @@ name: test ...@@ -2,8 +2,6 @@ name: test
on: on:
push: push:
branches:
- master
pull_request: pull_request:
jobs: jobs:
......
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment