diff --git a/.github/workflows/link-validation.yaml b/.github/workflows/link-validation.yaml index 08ae2e1acc5..f36037e68c2 100644 --- a/.github/workflows/link-validation.yaml +++ b/.github/workflows/link-validation.yaml @@ -2,8 +2,6 @@ name: Verifies documentation links on: push: - branches: - - master pull_request: schedule: - cron: "0 3 * * 1" # Every Monday at 03:00 diff --git a/.github/workflows/docs.yaml b/.github/workflows/publish-docs.yaml similarity index 74% rename from .github/workflows/docs.yaml rename to .github/workflows/publish-docs.yaml index be7e254de89..97744f6ea4f 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/publish-docs.yaml @@ -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 @@ -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: @@ -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 "bot@arduino.cc" git config --global user.name "ArduinoBot" diff --git a/.github/workflows/python-lint.yaml b/.github/workflows/python-lint.yaml index 14dc459486e..c736d875cd6 100644 --- a/.github/workflows/python-lint.yaml +++ b/.github/workflows/python-lint.yaml @@ -2,8 +2,6 @@ name: "Lints Python code" on: push: - branches: - - master paths: - "**.py" - ".flake8" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a5782720d7d..3b9e0f036da 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,8 +2,6 @@ name: test on: push: - branches: - - master pull_request: jobs: diff --git a/.github/workflows/validate-docs.yaml b/.github/workflows/validate-docs.yaml new file mode 100644 index 00000000000..df2511b70f1 --- /dev/null +++ b/.github/workflows/validate-docs.yaml @@ -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