Skip to content

Commit

Permalink
Auto merge of rust-lang#74565 - pietroalbini:build-on-gha, r=Mark-Sim…
Browse files Browse the repository at this point in the history
…ulacrum

Upload builds from GHA instead of Azure Pipelines

This PR does two things:

* Enables RLA comments on PRs (needed after the switch to GHA in RLA).
* Switches GitHub Actions as the CI authorized to upload non-macOS builds.

Note that Docker/LLVM caches will likely be busted.

r? @Mark-Simulacrum
  • Loading branch information
bors committed Jul 21, 2020
2 parents 8ad7bc3 + 750ad20 commit aca77cd
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 31 deletions.
68 changes: 44 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
name: PR
env:
CI_JOB_NAME: "${{ matrix.name }}"
SCCACHE_BUCKET: rust-lang-gha-caches
TOOLSTATE_REPO: "https://github.com/pietroalbini/rust-toolstate"
CACHE_DOMAIN: ci-caches-gha.rust-lang.org
SCCACHE_BUCKET: rust-lang-ci-sccache2
TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
CACHE_DOMAIN: ci-caches.rust-lang.org
if: "github.event_name == 'pull_request'"
strategy:
matrix:
Expand Down Expand Up @@ -63,6 +63,11 @@ jobs:
with:
github_token: "${{ secrets.github_token }}"
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try'"
- name: configure the PR in which the error message will be posted
run: "echo \"[CI_PR_NUMBER=$num]\""
env:
num: "${{ github.event.number }}"
if: "success() && !env.SKIP_JOBS && github.event_name == 'pull_request'"
- name: add extra environment variables
run: src/ci/scripts/setup-environment.sh
env:
Expand Down Expand Up @@ -133,14 +138,14 @@ jobs:
name: try
env:
CI_JOB_NAME: "${{ matrix.name }}"
SCCACHE_BUCKET: rust-lang-gha-caches
DEPLOY_BUCKET: rust-lang-gha
TOOLSTATE_REPO: "https://github.com/pietroalbini/rust-toolstate"
TOOLSTATE_ISSUES_API_URL: "https://api.github.com/repos/pietroalbini/rust-toolstate/issues"
SCCACHE_BUCKET: rust-lang-ci-sccache2
DEPLOY_BUCKET: rust-lang-ci2
TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
TOOLSTATE_ISSUES_API_URL: "https://api.github.com/repos/rust-lang/rust/issues"
TOOLSTATE_PUBLISH: 1
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZOMUQATD5
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZH5AYXDVF
CACHE_DOMAIN: ci-caches-gha.rust-lang.org
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZI5DHEBFL
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZN24CBO55
CACHE_DOMAIN: ci-caches.rust-lang.org
if: "github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'"
strategy:
matrix:
Expand All @@ -162,6 +167,11 @@ jobs:
with:
github_token: "${{ secrets.github_token }}"
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try'"
- name: configure the PR in which the error message will be posted
run: "echo \"[CI_PR_NUMBER=$num]\""
env:
num: "${{ github.event.number }}"
if: "success() && !env.SKIP_JOBS && github.event_name == 'pull_request'"
- name: add extra environment variables
run: src/ci/scripts/setup-environment.sh
env:
Expand Down Expand Up @@ -232,14 +242,14 @@ jobs:
name: auto
env:
CI_JOB_NAME: "${{ matrix.name }}"
SCCACHE_BUCKET: rust-lang-gha-caches
DEPLOY_BUCKET: rust-lang-gha
TOOLSTATE_REPO: "https://github.com/pietroalbini/rust-toolstate"
TOOLSTATE_ISSUES_API_URL: "https://api.github.com/repos/pietroalbini/rust-toolstate/issues"
SCCACHE_BUCKET: rust-lang-ci-sccache2
DEPLOY_BUCKET: rust-lang-ci2
TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
TOOLSTATE_ISSUES_API_URL: "https://api.github.com/repos/rust-lang/rust/issues"
TOOLSTATE_PUBLISH: 1
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZOMUQATD5
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZH5AYXDVF
CACHE_DOMAIN: ci-caches-gha.rust-lang.org
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZI5DHEBFL
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZN24CBO55
CACHE_DOMAIN: ci-caches.rust-lang.org
if: "github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
strategy:
matrix:
Expand Down Expand Up @@ -479,6 +489,11 @@ jobs:
with:
github_token: "${{ secrets.github_token }}"
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try'"
- name: configure the PR in which the error message will be posted
run: "echo \"[CI_PR_NUMBER=$num]\""
env:
num: "${{ github.event.number }}"
if: "success() && !env.SKIP_JOBS && github.event_name == 'pull_request'"
- name: add extra environment variables
run: src/ci/scripts/setup-environment.sh
env:
Expand Down Expand Up @@ -604,6 +619,11 @@ jobs:
with:
github_token: "${{ secrets.github_token }}"
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try'"
- name: configure the PR in which the error message will be posted
run: "echo \"[CI_PR_NUMBER=$num]\""
env:
num: "${{ github.event.number }}"
if: "success() && !env.SKIP_JOBS && github.event_name == 'pull_request'"
- name: add extra environment variables
run: src/ci/scripts/setup-environment.sh
env:
Expand Down Expand Up @@ -674,14 +694,14 @@ jobs:
name: master
runs-on: ubuntu-latest
env:
SCCACHE_BUCKET: rust-lang-gha-caches
DEPLOY_BUCKET: rust-lang-gha
TOOLSTATE_REPO: "https://github.com/pietroalbini/rust-toolstate"
TOOLSTATE_ISSUES_API_URL: "https://api.github.com/repos/pietroalbini/rust-toolstate/issues"
SCCACHE_BUCKET: rust-lang-ci-sccache2
DEPLOY_BUCKET: rust-lang-ci2
TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
TOOLSTATE_ISSUES_API_URL: "https://api.github.com/repos/rust-lang/rust/issues"
TOOLSTATE_PUBLISH: 1
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZOMUQATD5
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZH5AYXDVF
CACHE_DOMAIN: ci-caches-gha.rust-lang.org
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZI5DHEBFL
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZN24CBO55
CACHE_DOMAIN: ci-caches.rust-lang.org
if: "github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'rust-lang-ci/rust'"
steps:
- name: checkout the source code
Expand Down
5 changes: 4 additions & 1 deletion src/ci/azure-pipelines/auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ trigger:
- auto

variables:
- group: prod-credentials
- group: dummy-credentials

jobs:
- job: Linux
Expand Down Expand Up @@ -79,6 +79,9 @@ jobs:
vmImage: macos-10.15
steps:
- template: steps/run.yml
variables:
# We're still uploading macOS builds from Azure Pipelines.
- group: prod-credentials
strategy:
matrix:
# OSX builders running tests, these run the full test suite.
Expand Down
2 changes: 1 addition & 1 deletion src/ci/azure-pipelines/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ trigger:
- master

variables:
- group: prod-credentials
- group: dummy-credentials

pool:
vmImage: ubuntu-16.04
Expand Down
2 changes: 1 addition & 1 deletion src/ci/azure-pipelines/try.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trigger:
- try

variables:
- group: prod-credentials
- group: dummy-credentials

jobs:
- job: Linux
Expand Down
32 changes: 28 additions & 4 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,26 @@ x--expand-yaml-anchors--remove:
CI_JOB_NAME: ${{ matrix.name }}

- &public-variables
SCCACHE_BUCKET: rust-lang-gha-caches
TOOLSTATE_REPO: https://github.com/pietroalbini/rust-toolstate
CACHE_DOMAIN: ci-caches-gha.rust-lang.org
SCCACHE_BUCKET: rust-lang-ci-sccache2
TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
CACHE_DOMAIN: ci-caches.rust-lang.org

- &prod-variables
SCCACHE_BUCKET: rust-lang-ci-sccache2
DEPLOY_BUCKET: rust-lang-ci2
TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
TOOLSTATE_ISSUES_API_URL: https://api.github.com/repos/rust-lang/rust/issues
TOOLSTATE_PUBLISH: 1
# AWS_SECRET_ACCESS_KEYs are stored in GitHub's secrets storage, named
# AWS_SECRET_ACCESS_KEY_<keyid>. Including the key id in the name allows to
# rotate them in a single branch while keeping the old key in another
# branch, which wouldn't be possible if the key was named with the kind
# (caches, artifacts...).
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZI5DHEBFL
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZN24CBO55
CACHE_DOMAIN: ci-caches.rust-lang.org

- &dummy-variables
SCCACHE_BUCKET: rust-lang-gha-caches
DEPLOY_BUCKET: rust-lang-gha
TOOLSTATE_REPO: https://github.com/pietroalbini/rust-toolstate
Expand Down Expand Up @@ -92,6 +107,15 @@ x--expand-yaml-anchors--remove:
if: success() && !env.SKIP_JOB && github.ref != 'refs/heads/try'
<<: *step

# Rust Log Analyzer can't currently detect the PR number of a GitHub
# Actions build on its own, so a hint in the log message is needed to
# point it in the right direction.
- name: configure the PR in which the error message will be posted
run: echo "[CI_PR_NUMBER=$num]"
env:
num: ${{ github.event.number }}
if: success() && !env.SKIP_JOBS && github.event_name == 'pull_request'

- name: add extra environment variables
run: src/ci/scripts/setup-environment.sh
env:
Expand Down Expand Up @@ -556,7 +580,7 @@ jobs:
<<: *base-ci-job
name: auto-fallible
env:
<<: [*shared-ci-variables, *prod-variables]
<<: [*shared-ci-variables, *dummy-variables]
if: github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'
strategy:
matrix:
Expand Down

0 comments on commit aca77cd

Please sign in to comment.