chore: initial commit #1
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
| --- | |
| ### <https://github.com/shivammathur/setup-php> | |
| ### <https://github.com/shivammathur/setup-php/blob/baf9535ba58ae8ac3a7362d932ca85fc38621a5d/examples/bedrock.yml> | |
| name: Build + Check | |
| "on": | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - "ci/**" | |
| paths: | |
| # Always run when changing the workflow definition itself | |
| - ".github/workflows/build-check.yml" | |
| # Allow manual trigger | |
| workflow_dispatch: | |
| # Required for required checks on pull requests | |
| # <https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#merge_group> | |
| merge_group: | |
| concurrency: | |
| # yamllint disable-line rule:line-length | |
| group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}" | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| PRJ_ROOT: ${{ github.workspace }} | |
| PRJ_CONFIG_HOME: "${{ github.workspace }}/.config" | |
| jobs: | |
| build-check: | |
| runs-on: ubuntu-latest | |
| # Safety net in case of hanging executable | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/create-github-app-token@v1 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.OPS_APP_ID }} | |
| private-key: ${{ secrets.OPS_APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| - name: Get GitHub App User ID | |
| id: get-user-id | |
| # yamllint disable-line rule:line-length | |
| run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| # yamllint disable rule:line-length | |
| - run: | | |
| git config --global user.name \ | |
| '${{ steps.app-token.outputs.app-slug }}[bot]' | |
| git config --global user.email \ | |
| '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>' | |
| # yamllint enable rule:line-length | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| ref: ${{ github.head_ref }} | |
| # Make sure the value of GITHUB_TOKEN will not be persisted in repo's config | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup-nix | |
| with: | |
| cachix_auth_token: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| github_token: ${{ steps.app-token.outputs.token }} | |
| - uses: ./.github/actions/setup-php | |
| - uses: ./.github/actions/build |