fix: split buildtest into a unit-test pass and a separate benchmark pass #1128
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
| --- # PR: create pull requests for pushed branches | |
| # Maintain in repo: funfair-server-template | |
| name: "PR: Create" | |
| on: | |
| push: | |
| branches-ignore: | |
| - master | |
| - main | |
| - develop | |
| - "release/**" | |
| - "hotfix/**" | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| concurrency: | |
| group: ${{github.workflow}}-${{github.ref}} | |
| cancel-in-progress: true | |
| env: | |
| REPO: ${{github.repository}} | |
| REPO_OWNER: ${{github.repository_owner}} | |
| jobs: | |
| pull-request: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Initialise Workspace" | |
| if: runner.environment == 'self-hosted' | |
| shell: bash | |
| run: sudo chown -R "$USER:$USER" "$GITHUB_WORKSPACE" | |
| - name: "Set Active Environment" | |
| shell: bash | |
| run: | | |
| { | |
| echo "ACTIVE_RUNNER_NAME=${{runner.name}}" | |
| echo "ACTIVE_HOSTNAME=$HOSTNAME" | |
| echo "ACTIVE_USER=$USER" | |
| } >> "$GITHUB_ENV" | |
| - name: "Checkout source" | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| clean: true | |
| fetch-depth: 1 | |
| - name: "Find PR For branch" | |
| id: findPr | |
| uses: ./.github/actions/find-pull-request | |
| with: | |
| branch: ${{github.ref_name}} | |
| - name: "Existing PR Information" | |
| if: steps.findPr.outputs.number != '' | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| PR_NUMBER: ${{steps.findPr.outputs.number}} | |
| with: | |
| script: | | |
| core.info(`Pull request already exists with id: ${process.env.PR_NUMBER}`); | |
| core.info(`URL: https://github.com/${process.env.REPO}/pull/${process.env.PR_NUMBER}`); | |
| - name: "Read PR Template" | |
| id: pr-template | |
| if: steps.findPr.outputs.number == '' | |
| uses: ./.github/actions/read-file | |
| with: | |
| path: ./.github/PULL_REQUEST_TEMPLATE.md | |
| - name: "Get last commit info" | |
| id: commit-info | |
| if: steps.findPr.outputs.number == '' | |
| shell: bash | |
| run: | | |
| title="$(git log -1 --pretty=%s)" | |
| echo "commit-title=$title" >> "$GITHUB_OUTPUT" | |
| - name: "Check Required Secrets" | |
| if: steps.findPr.outputs.number == '' | |
| shell: bash | |
| run: | | |
| if [ -z "${{secrets.SOURCE_PUSH_TOKEN}}" ]; then | |
| echo "::error::SOURCE_PUSH_TOKEN is required but not set" | |
| exit 1 | |
| fi | |
| - name: "Status" | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| FIND_PR_NUMBER: ${{steps.findPr.outputs.number}} | |
| with: | |
| script: | | |
| const prOk = process.env.FIND_PR_NUMBER === ''; | |
| core.info(`Repo: ${process.env.REPO}`); | |
| core.info(`Owner: ${process.env.REPO_OWNER}`); | |
| core.info(`PR OK: ${prOk}`); | |
| await core.summary | |
| .addHeading('Status') | |
| .addTable([ | |
| [{data: 'Property', header: true}, {data: 'Value', header: true}], | |
| ['Repo', process.env.REPO], | |
| ['Owner', process.env.REPO_OWNER], | |
| ['PR OK', prOk ? '✅ Yes' : '❌ No'], | |
| ]) | |
| .write(); | |
| - name: "Check Required Secrets" | |
| if: steps.findPr.outputs.number == '' | |
| shell: bash | |
| run: | | |
| if [ -z "${{secrets.PR_CREATE_TOKEN}}" ]; then | |
| echo "::error::PR_CREATE_TOKEN is required but not set" | |
| exit 1 | |
| fi | |
| - name: "Create Pull Request" | |
| if: steps.findPr.outputs.number == '' | |
| id: open-pr | |
| uses: ./.github/actions/create-pull-request | |
| with: | |
| github-token: ${{secrets.PR_CREATE_TOKEN}} | |
| destination-branch: "main" | |
| assignee: ${{github.actor}} | |
| labels: "auto-pr" | |
| draft: true | |
| title: ${{steps.commit-info.outputs.commit-title}} | |
| body: ${{steps.pr-template.outputs.content}} | |
| - name: "New PR Details" | |
| if: steps.findPr.outputs.number == '' | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| PR_URL: ${{steps.open-pr.outputs.pr_url}} | |
| PR_NUMBER: ${{steps.open-pr.outputs.pr_number}} | |
| HAS_CHANGED_FILES: ${{steps.open-pr.outputs.has_changed_files}} | |
| with: | |
| script: | | |
| core.info(`URL: ${process.env.PR_URL}`); | |
| core.info(`PR: ${process.env.PR_NUMBER}`); | |
| core.info(`CF: ${process.env.HAS_CHANGED_FILES}`); | |
| await core.summary | |
| .addHeading('New PR Details') | |
| .addTable([ | |
| [{data: 'Property', header: true}, {data: 'Value', header: true}], | |
| ['URL', process.env.PR_URL], | |
| ['PR', process.env.PR_NUMBER], | |
| ['CF', process.env.HAS_CHANGED_FILES], | |
| ]) | |
| .write(); | |
| - name: "Sync Labels" | |
| if: steps.findPr.outputs.number == '' | |
| uses: ./.github/actions/sync-labels | |
| with: | |
| github-token: ${{secrets.SOURCE_PUSH_TOKEN}} | |
| pr-number: ${{steps.open-pr.outputs.pr_number}} |