π· ci(build): always post build gate on pull requests (#406) #844
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: π¦ toml-fmt-common | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| schedule: | |
| - cron: "0 8 * * *" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| changes: | |
| name: π changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| run: ${{ github.event_name != 'pull_request' || steps.filter.outputs.run == 'true' }} | |
| steps: | |
| - name: π₯ Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: π Check for changes | |
| uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 | |
| id: filter | |
| with: | |
| filters: | | |
| run: | |
| - 'toml-fmt-common/**' | |
| - '.github/workflows/toml_fmt_common_build.yaml' | |
| build: | |
| name: π¨ build | |
| needs: changes | |
| if: needs.changes.outputs.run == 'true' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: toml-fmt-common | |
| steps: | |
| - name: π₯ Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: π¦ Setup uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "pyproject.toml" | |
| - name: π¨ Build package | |
| run: uv build --python 3.14 --python-preference only-managed --sdist --wheel . --out-dir dist | |
| all-pass: | |
| name: β toml-fmt-common-build | |
| if: always() | |
| needs: [changes, build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Decide whether all jobs passed or were skipped | |
| run: | | |
| if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then | |
| echo "Some jobs failed or were canceled" | |
| exit 1 | |
| fi | |
| echo "All jobs passed or were skipped" |