ci: auto-update documentation after releases #437
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Continuous Integration | |
| permissions: read-all | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - devs/** | |
| concurrency: | |
| # yamllint disable-line rule:line-length | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| linters: | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout ποΈ | |
| uses: actions/checkout@v6.0.2 | |
| - name: Setup Python π§ | |
| uses: actions/setup-python@v6.2.0 | |
| with: | |
| python-version: 3.14.3 | |
| - name: Check workflow files | |
| uses: docker://rhysd/actionlint:1.7.11 | |
| with: | |
| args: -color | |
| - name: Test π | |
| run: | | |
| # nosemgrep: generic.ci.security.use-frozen-lockfile.use-frozen-lockfile-pip | |
| pip install semgrep yamllint | |
| semgrep --config=auto --error | |
| yamllint . | |
| autodoc: | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Run auto-doc | |
| uses: tj-actions/auto-doc@v3.6.0 | |
| with: | |
| use_code_blocks: true | |
| col_max_words: 120 | |
| use_major_version: true | |
| - name: Verify Changed files | |
| uses: tj-actions/verify-changed-files@v20 | |
| id: verify-changed-files | |
| with: | |
| files: | | |
| README.md | |
| fail-if-changed: true | |
| fail-message: Action documentation is out of date. Run `./generate-doc.sh` | |
| - name: Display diff | |
| if: failure() | |
| run: | | |
| git diff | |
| exit 1 | |
| test-scopes: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout ποΈ | |
| uses: actions/checkout@v6.0.2 | |
| - name: Trying action scopes-git-refs | |
| id: scopes-git-refs | |
| uses: ./ | |
| with: | |
| action: scopes-git-refs | |
| mergify_config_path: zfixtures/mergify.yml | |
| - name: Trying action scopes-upload | |
| id: scopes-upload | |
| uses: ./ | |
| with: | |
| action: scopes-upload | |
| token: ${{ secrets.MERGIFY_TOKEN }} | |
| scopes: scope1,scope2 | |
| mergify_config_path: zfixtures/mergify.yml | |
| - name: Trying action scopes | |
| id: scopes-detection | |
| uses: ./ | |
| with: | |
| action: scopes | |
| token: ${{ secrets.MERGIFY_TOKEN }} | |
| mergify_config_path: zfixtures/mergify.yml | |
| - name: Check scopes | |
| env: | |
| SCOPES: ${{ steps.scopes-detection.outputs.scopes }} | |
| EVERYTHING: ${{ fromJSON(steps.scopes-detection.outputs.scopes).everything }} | |
| EVERYTHING_BOOL: ${{ fromJSON(steps.scopes-detection.outputs.scopes).everything == 'true' }} | |
| run: | | |
| echo "SCOPES: $SCOPES" | |
| test "$EVERYTHING" == "true" | |
| test "$EVERYTHING_BOOL" == "true" | |
| test-junit: | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout ποΈ | |
| uses: actions/checkout@v6.0.2 | |
| - name: Prepare mockserver | |
| run: | | |
| docker compose up -d | |
| sleep 1 | |
| docker compose logs | |
| - name: Run action | |
| uses: ./ | |
| with: | |
| action: junit-process | |
| token: fake-valid-token | |
| report_path: zfixtures/*.xml | |
| mergify_api_url: http://localhost:1080 | |
| mergify_config_path: zfixtures/mergify.yml | |
| - name: Run action with error scenario β | |
| id: error500 | |
| continue-on-error: true | |
| uses: ./ | |
| with: | |
| action: junit-process | |
| token: fake-valid-token | |
| report_path: zfixtures/junit_example.xml | |
| mergify_api_url: http://localhost:1085 | |
| mergify_config_path: zfixtures/mergify.yml | |
| - name: Dump mockserver logs | |
| if: always() | |
| run: | | |
| docker compose logs | |
| test-wait-jobs: | |
| needs: [test-junit, test-scopes, linters] | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout ποΈ | |
| uses: actions/checkout@v6.0.2 | |
| - name: Trying action | |
| id: scopes-detection | |
| uses: ./ | |
| with: | |
| action: wait-jobs | |
| jobs: ${{ toJSON(needs) }} | |
| mergify_config_path: zfixtures/mergify.yml | |
| all-greens: | |
| if: ${{ !cancelled() }} | |
| needs: | |
| - linters | |
| - autodoc | |
| - test-scopes | |
| - test-junit | |
| - test-wait-jobs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Verify all jobs succeeded | |
| uses: Mergifyio/gha-mergify-ci@v14 | |
| with: | |
| action: wait-jobs | |
| jobs: ${{ toJSON(needs) }} |