|
| 1 | +# Please ping @DilumAluthge when making any changes to this file. |
| 2 | + |
| 3 | +# This is just a short-term solution until we have migrated all of CI to Buildkite. |
| 4 | +# |
| 5 | +# 1. TODO: delete this file once we have migrated all of CI to Buildkite. |
| 6 | +# |
| 7 | +# 2. TODO: disable GitHub Actions on the `JuliaLang/julia` repository once we have migrated all |
| 8 | +# of CI to Buildkite. |
| 9 | + |
| 10 | +# Here are some steps that we take in this workflow file for security reasons: |
| 11 | +# 1. We do not checkout any code. |
| 12 | +# 2. We do not run any external actions. |
| 13 | + |
| 14 | +name: Statuses |
| 15 | + |
| 16 | +on: |
| 17 | + push: |
| 18 | + branches: |
| 19 | + - 'master' |
| 20 | + - 'release-*' |
| 21 | + # When using the `pull_request_target` event, all PRs will get a `GITHUB_TOKEN` that has |
| 22 | + # write permissions, even if the PR is from a fork. |
| 23 | + # Therefore, for security reasons, we do not checkout any code in this workflow. |
| 24 | + pull_request: |
| 25 | + branches: |
| 26 | + - 'master' |
| 27 | + - 'release-*' |
| 28 | + |
| 29 | +# These are the permissions for the `GITHUB_TOKEN` token. |
| 30 | +# We should only give the token the minimum necessary set of permissions. |
| 31 | +permissions: |
| 32 | + statuses: write |
| 33 | + actions: none |
| 34 | + checks: none |
| 35 | + contents: none |
| 36 | + deployments: none |
| 37 | + issues: none |
| 38 | + discussions: none |
| 39 | + packages: none |
| 40 | + pull-requests: none |
| 41 | + repository-projects: none |
| 42 | + security-events: none |
| 43 | + |
| 44 | +jobs: |
| 45 | + statuses: |
| 46 | + name: statuses |
| 47 | + runs-on: ubuntu-latest |
| 48 | + if: github.repository == 'JuliaLang/julia' |
| 49 | + strategy: |
| 50 | + fail-fast: false |
| 51 | + steps: |
| 52 | + - run: echo "SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV |
| 53 | + if: github.event_name == 'pull_request' |
| 54 | + |
| 55 | + - run: echo "SHA=${{ env.GITHUB_SHA }}" >> $GITHUB_ENV |
| 56 | + if: github.event_name != 'pull_request' |
| 57 | + |
| 58 | + - run: echo "The SHA is ${{ env.SHA }}" |
| 59 | + |
| 60 | + # As we incrementally migrate individual jobs from Buildbot to Buildkite, we should |
| 61 | + # remove them from the `context_list`. |
| 62 | + - run: | |
| 63 | + declare -a CONTEXT_LIST=( |
| 64 | + "buildbot/package_freebsd64" |
| 65 | + "buildbot/package_linux32" |
| 66 | + "buildbot/package_linuxaarch64" |
| 67 | + "buildbot/package_linuxarmv7l" |
| 68 | + "buildbot/package_linuxppc64le" |
| 69 | + "buildbot/package_macos64" |
| 70 | + "buildbot/package_macosaarch64" |
| 71 | + "buildbot/package_musl64" |
| 72 | + "buildbot/package_win32" |
| 73 | + "buildbot/package_win64" |
| 74 | + "buildbot/tester_freebsd64" |
| 75 | + "buildbot/tester_linux32" |
| 76 | + "buildbot/tester_linux64" |
| 77 | + "buildbot/tester_linuxaarch64" |
| 78 | + "buildbot/tester_linuxarmv7l" |
| 79 | + "buildbot/tester_linuxppc64le" |
| 80 | + "buildbot/tester_macos64" |
| 81 | + "buildbot/tester_macosaarch64" |
| 82 | + "buildbot/tester_musl64" |
| 83 | + "buildbot/tester_win32" |
| 84 | + "buildbot/tester_win64" |
| 85 | + ) |
| 86 | + for CONTEXT in "${CONTEXT_LIST[@]}" |
| 87 | + do |
| 88 | + curl \ |
| 89 | + -X POST \ |
| 90 | + -H "Authorization: token $GITHUB_TOKEN" \ |
| 91 | + -H "Accept: application/vnd.github.v3+json" \ |
| 92 | + -d "{\"context\": \"$CONTEXT\", \"state\": \"$STATE\"}" \ |
| 93 | + https://api.github.com/repos/JuliaLang/julia/statuses/${{ env.SHA }} |
| 94 | + done |
| 95 | + env: |
| 96 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 97 | + STATE: "pending" |
0 commit comments