| Josh Bleecher Snyder | efda396 | 2025-04-30 13:09:42 -0700 | [diff] [blame] | 1 | # This is a copy of queue-main.yml, but with a different branch pattern. |
| Josh Bleecher Snyder | 008f958 | 2025-06-04 16:26:15 -0700 | [diff] [blame] | 2 | # It does not push the result anywhere or notify Discord; it logs instead. |
| Josh Bleecher Snyder | efda396 | 2025-04-30 13:09:42 -0700 | [diff] [blame] | 3 | # It is meant for people changing how the commit queue works: |
| 4 | # You can hack on the workflows, push to queue-dev-$USER, and iterate. |
| 5 | # Please keep this file in sync with queue-main.yml. |
| 6 | |
| 7 | name: Dev Commit Queue |
| 8 | on: |
| 9 | push: |
| 10 | branches: |
| 11 | - "queue-dev-*" |
| 12 | |
| 13 | permissions: read-all |
| 14 | |
| 15 | jobs: |
| 16 | formatting: |
| 17 | uses: ./.github/workflows/formatting.yml |
| 18 | permissions: |
| 19 | contents: write |
| 20 | with: |
| 21 | auto_fix: true |
| 22 | |
| 23 | go-test: |
| 24 | needs: [formatting] |
| 25 | uses: ./.github/workflows/go_test.yml |
| 26 | permissions: read-all |
| Josh Bleecher Snyder | 936ba62 | 2025-04-30 20:53:21 +0000 | [diff] [blame] | 27 | with: |
| 28 | ref: ${{ needs.formatting.outputs.commit_sha }} |
| Philip Zeyliger | c314f0c | 2025-07-16 16:48:46 -0700 | [diff] [blame] | 29 | include-slow-tests: false |
| Josh Bleecher Snyder | efda396 | 2025-04-30 13:09:42 -0700 | [diff] [blame] | 30 | |
| 31 | ui-test: |
| 32 | needs: [formatting] |
| 33 | uses: ./.github/workflows/webui_test.yml |
| 34 | permissions: read-all |
| Josh Bleecher Snyder | 936ba62 | 2025-04-30 20:53:21 +0000 | [diff] [blame] | 35 | with: |
| 36 | ref: ${{ needs.formatting.outputs.commit_sha }} |
| Josh Bleecher Snyder | efda396 | 2025-04-30 13:09:42 -0700 | [diff] [blame] | 37 | |
| 38 | push-to-main: |
| 39 | runs-on: ubuntu-latest |
| 40 | needs: [go-test, ui-test, formatting] |
| 41 | permissions: |
| 42 | contents: write |
| 43 | steps: |
| 44 | - uses: actions/checkout@v4 |
| 45 | with: |
| 46 | fetch-depth: 0 |
| 47 | |
| 48 | - name: Push to main |
| Josh Bleecher Snyder | 6e46360 | 2025-05-28 18:10:59 +0000 | [diff] [blame] | 49 | id: push |
| Josh Bleecher Snyder | efda396 | 2025-04-30 13:09:42 -0700 | [diff] [blame] | 50 | run: | |
| 51 | COMMIT_TO_PUSH="HEAD" |
| 52 | if [[ "${{ needs.formatting.outputs.commit_sha }}" != "" ]]; then |
| 53 | echo "Using formatted commit: ${{ needs.formatting.outputs.commit_sha }}" |
| 54 | COMMIT_TO_PUSH="${{ needs.formatting.outputs.commit_sha }}" |
| 55 | fi |
| 56 | |
| Josh Bleecher Snyder | 6e46360 | 2025-05-28 18:10:59 +0000 | [diff] [blame] | 57 | # Get the actual commit SHA that we're pushing |
| 58 | COMMIT_SHA=$(git rev-parse "${COMMIT_TO_PUSH}") |
| 59 | echo "commit_sha=${COMMIT_SHA}" >> $GITHUB_OUTPUT |
| 60 | |
| Philip Zeyliger | fb56a5c | 2025-07-16 22:38:38 +0000 | [diff] [blame] | 61 | # Ensure we have the latest main branch reference |
| 62 | git fetch origin main |
| 63 | |
| Josh Bleecher Snyder | 837699b | 2025-05-28 18:58:17 +0000 | [diff] [blame] | 64 | # Get the list of commits that would be pushed (in chronological order) |
| Philip Zeyliger | fb56a5c | 2025-07-16 22:38:38 +0000 | [diff] [blame] | 65 | # Use FETCH_HEAD as the base to avoid rewriting local main reference |
| 66 | COMMITS_TO_NOTIFY=$(git log FETCH_HEAD.."${COMMIT_TO_PUSH}" --reverse --format="%H" | tr '\n' ' ') |
| Josh Bleecher Snyder | 837699b | 2025-05-28 18:58:17 +0000 | [diff] [blame] | 67 | echo "commits_to_notify=${COMMITS_TO_NOTIFY}" >> $GITHUB_OUTPUT |
| 68 | echo "Commits that would be pushed and notified: ${COMMITS_TO_NOTIFY}" |
| 69 | |
| Josh Bleecher Snyder | efda396 | 2025-04-30 13:09:42 -0700 | [diff] [blame] | 70 | echo "Would push to main: ${COMMIT_TO_PUSH}" |
| 71 | env: |
| 72 | GITHUB_TOKEN: ${{ github.token }} |