Pull Request #3431
Workflow file for this run
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
| --- | |
| # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
| name: Pull Request | |
| on: | |
| merge_group: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| prepare: | |
| name: Prepare | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| outputs: | |
| changed-files: ${{ steps.changed-files.outputs.changed_files }} | |
| steps: | |
| - name: Get changed files | |
| uses: bjw-s-labs/action-changed-files@a9a36fb08ce06db9b02fbd8026cc2c0945eb9841 # v0.6.0 | |
| id: changed-files | |
| with: | |
| path: apps | |
| include_only_directories: true | |
| max_depth: 1 | |
| go-check: | |
| name: Go Compile & Vet | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Mise | |
| uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0 | |
| with: | |
| experimental: true | |
| install_args: --locked | |
| - name: Restore Go Modules | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: | | |
| ~/.cache/go-build | |
| ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }} | |
| - name: Compile tests | |
| run: go test -run='^$' ./... | |
| - name: Vet | |
| run: go vet ./... | |
| hadolint: | |
| name: Hadolint | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Mise | |
| uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0 | |
| with: | |
| experimental: true | |
| install_args: --locked | |
| - name: Hadolint | |
| run: git ls-files -z '*Dockerfile' | xargs -0 -r hadolint | |
| build: | |
| if: ${{ needs.prepare.outputs.changed-files != '[]' }} | |
| name: Build ${{ matrix.app }} | |
| needs: | |
| - prepare | |
| uses: $/.github/workflows/app-builder.yaml | |
| permissions: | |
| attestations: write | |
| contents: read | |
| id-token: write | |
| packages: write | |
| strategy: | |
| matrix: | |
| app: ${{ fromJSON(needs.prepare.outputs.changed-files) }} | |
| fail-fast: false | |
| max-parallel: 4 | |
| with: | |
| app: ${{ matrix.app }} | |
| release: false | |
| workflow-lint: | |
| name: Workflow Lint | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Mise | |
| uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0 | |
| with: | |
| install: false | |
| - name: Resolve linter versions | |
| id: tools | |
| run: | | |
| echo "actionlint=$(mise config get tools.actionlint)" >> "$GITHUB_OUTPUT" | |
| echo "zizmor=$(mise config get tools.zizmor)" >> "$GITHUB_OUTPUT" | |
| - name: Lint workflows | |
| uses: home-operations/.github/actions/workflow-lint@69cad1e407df8070dd9cfc3314551e473544014e # workflow-lint-v1.0.3 | |
| with: | |
| actionlint-version: ${{ steps.tools.outputs.actionlint }} | |
| zizmor-version: ${{ steps.tools.outputs.zizmor }} | |
| status: | |
| if: ${{ !cancelled() }} | |
| name: Build Success | |
| needs: | |
| - build | |
| - go-check | |
| - hadolint | |
| - prepare | |
| - workflow-lint | |
| runs-on: ubuntu-24.04 | |
| permissions: {} | |
| steps: | |
| # cancelled counts as failed: !cancelled() above still runs this job when | |
| # individual needs were cancelled but the run was not, and a required job | |
| # that never reached a verdict must not clear the merge gate. | |
| - name: Any jobs failed? | |
| if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | |
| run: | | |
| exit 1 | |
| - name: All jobs passed or skipped? | |
| if: ${{ !(contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) }} | |
| run: | | |
| echo "All jobs passed or skipped" && echo "${{ toJSON(needs.*.result) }}" |