2019-11-26 11:06:30 +00:00
|
|
|
#############################################################
|
|
|
|
# WARNING: automatically generated file, DO NOT CHANGE! #
|
|
|
|
#############################################################
|
|
|
|
|
|
|
|
# This file was automatically generated by the expand-yaml-anchors tool. The
|
|
|
|
# source file that generated this one is:
|
|
|
|
#
|
|
|
|
# src/ci/github-actions/ci.yml
|
|
|
|
#
|
|
|
|
# Once you make changes to that file you need to run:
|
|
|
|
#
|
|
|
|
# ./x.py run src/tools/expand-yaml-anchors/
|
|
|
|
#
|
|
|
|
# The CI build will fail if the tool is not run after changes to this file.
|
|
|
|
|
|
|
|
---
|
|
|
|
name: CI
|
|
|
|
"on":
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- auto
|
|
|
|
- try
|
2020-07-21 18:53:39 +00:00
|
|
|
- try-perf
|
2023-10-02 19:38:50 +00:00
|
|
|
- automation/bors/try
|
2019-11-26 11:06:30 +00:00
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- "**"
|
2022-09-02 16:37:17 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
2024-01-21 13:26:20 +00:00
|
|
|
packages: write
|
2020-04-22 16:53:11 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
2020-07-17 13:44:14 +00:00
|
|
|
shell: bash
|
2023-06-23 09:22:23 +00:00
|
|
|
concurrency:
|
2023-06-29 22:08:38 +00:00
|
|
|
group: "${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.sha) || github.ref }}"
|
2023-06-23 09:22:23 +00:00
|
|
|
cancel-in-progress: true
|
2019-11-26 11:06:30 +00:00
|
|
|
jobs:
|
2024-04-04 12:27:38 +00:00
|
|
|
calculate_matrix:
|
|
|
|
name: Calculate job matrix
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
jobs: "${{ steps.jobs.outputs.jobs }}"
|
|
|
|
steps:
|
|
|
|
- name: Checkout the source code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Calculate the CI job matrix
|
2024-04-19 19:41:49 +00:00
|
|
|
run: python3 src/ci/github-actions/calculate-job-matrix.py >> $GITHUB_OUTPUT
|
2024-04-04 12:27:38 +00:00
|
|
|
id: jobs
|
2024-04-20 07:07:11 +00:00
|
|
|
job:
|
|
|
|
name: "${{ matrix.name }}"
|
2024-04-04 12:27:38 +00:00
|
|
|
needs:
|
|
|
|
- calculate_matrix
|
2019-11-26 11:06:30 +00:00
|
|
|
env:
|
2024-04-20 07:07:11 +00:00
|
|
|
CI_JOB_NAME: "${{ matrix.image }}"
|
2023-02-01 02:13:57 +00:00
|
|
|
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
|
2023-06-07 23:20:39 +00:00
|
|
|
HEAD_SHA: "${{ github.event.pull_request.head.sha || github.sha }}"
|
2024-01-21 13:26:20 +00:00
|
|
|
DOCKER_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
2020-07-20 15:43:48 +00:00
|
|
|
SCCACHE_BUCKET: rust-lang-ci-sccache2
|
|
|
|
TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
|
|
|
|
CACHE_DOMAIN: ci-caches.rust-lang.org
|
2024-04-20 07:07:11 +00:00
|
|
|
continue-on-error: "${{ matrix.continue_on_error || false }}"
|
2019-11-26 11:06:30 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-04-04 12:27:38 +00:00
|
|
|
include: "${{ fromJSON(needs.calculate_matrix.outputs.jobs) }}"
|
2024-02-13 04:37:31 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: "${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }}"
|
2019-11-26 11:06:30 +00:00
|
|
|
timeout-minutes: 600
|
|
|
|
runs-on: "${{ matrix.os }}"
|
|
|
|
steps:
|
2024-02-13 04:37:31 +00:00
|
|
|
- if: "contains(matrix.os, 'windows')"
|
|
|
|
uses: msys2/setup-msys2@v2.22.0
|
|
|
|
with:
|
|
|
|
msystem: "${{ contains(matrix.name, 'i686') && 'mingw32' || 'mingw64' }}"
|
|
|
|
update: false
|
|
|
|
release: true
|
|
|
|
path-type: inherit
|
|
|
|
install: "make dos2unix diffutils\n"
|
2019-11-26 11:06:30 +00:00
|
|
|
- name: disable git crlf conversion
|
|
|
|
run: git config --global core.autocrlf false
|
|
|
|
- name: checkout the source code
|
2023-09-08 05:18:21 +00:00
|
|
|
uses: actions/checkout@v4
|
2019-11-26 11:06:30 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2020-07-20 15:11:30 +00:00
|
|
|
- name: configure the PR in which the error message will be posted
|
|
|
|
run: "echo \"[CI_PR_NUMBER=$num]\""
|
|
|
|
env:
|
|
|
|
num: "${{ github.event.number }}"
|
2021-02-26 02:41:25 +00:00
|
|
|
if: "success() && !env.SKIP_JOB && github.event_name == 'pull_request'"
|
2019-11-26 11:06:30 +00:00
|
|
|
- name: add extra environment variables
|
|
|
|
run: src/ci/scripts/setup-environment.sh
|
|
|
|
env:
|
|
|
|
EXTRA_VARIABLES: "${{ toJson(matrix.env) }}"
|
|
|
|
if: success() && !env.SKIP_JOB
|
|
|
|
- name: decide whether to skip this job
|
|
|
|
run: src/ci/scripts/should-skip-this.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
2021-05-06 16:47:37 +00:00
|
|
|
- name: ensure the channel matches the target branch
|
|
|
|
run: src/ci/scripts/verify-channel.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
2019-11-26 11:06:30 +00:00
|
|
|
- name: collect CPU statistics
|
|
|
|
run: src/ci/scripts/collect-cpu-stats.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
|
|
|
- name: show the current environment
|
|
|
|
run: src/ci/scripts/dump-environment.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
2023-10-03 02:18:44 +00:00
|
|
|
- name: install awscli
|
|
|
|
run: src/ci/scripts/install-awscli.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
2019-11-26 11:06:30 +00:00
|
|
|
- name: install sccache
|
|
|
|
run: src/ci/scripts/install-sccache.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
2022-11-19 20:18:09 +00:00
|
|
|
- name: select Xcode
|
|
|
|
run: src/ci/scripts/select-xcode.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
2019-11-26 11:06:30 +00:00
|
|
|
- name: install clang
|
|
|
|
run: src/ci/scripts/install-clang.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
2023-10-31 20:32:37 +00:00
|
|
|
- name: install tidy
|
|
|
|
run: src/ci/scripts/install-tidy.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
2019-11-26 11:06:30 +00:00
|
|
|
- name: install WIX
|
|
|
|
run: src/ci/scripts/install-wix.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
|
|
|
- name: disable git crlf conversion
|
|
|
|
run: src/ci/scripts/disable-git-crlf-conversion.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
2022-03-01 18:16:47 +00:00
|
|
|
- name: checkout submodules
|
|
|
|
run: src/ci/scripts/checkout-submodules.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
2019-11-26 11:06:30 +00:00
|
|
|
- name: install MSYS2
|
|
|
|
run: src/ci/scripts/install-msys2.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
|
|
|
- name: install MinGW
|
|
|
|
run: src/ci/scripts/install-mingw.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
|
|
|
- name: install ninja
|
|
|
|
run: src/ci/scripts/install-ninja.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
|
|
|
- name: enable ipv6 on Docker
|
|
|
|
run: src/ci/scripts/enable-docker-ipv6.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
|
|
|
- name: disable git crlf conversion
|
|
|
|
run: src/ci/scripts/disable-git-crlf-conversion.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
|
|
|
- name: ensure line endings are correct
|
|
|
|
run: src/ci/scripts/verify-line-endings.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
2021-07-29 17:00:13 +00:00
|
|
|
- name: ensure backported commits are in upstream branches
|
|
|
|
run: src/ci/scripts/verify-backported-commits.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
2022-01-20 20:18:04 +00:00
|
|
|
- name: ensure the stable version number is correct
|
|
|
|
run: src/ci/scripts/verify-stable-version-number.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
2019-11-26 11:06:30 +00:00
|
|
|
- name: run the build
|
2024-04-02 09:34:53 +00:00
|
|
|
run: src/ci/scripts/run-build-from-ci.sh 2>&1
|
2019-11-26 11:06:30 +00:00
|
|
|
env:
|
|
|
|
AWS_ACCESS_KEY_ID: "${{ env.CACHES_AWS_ACCESS_KEY_ID }}"
|
|
|
|
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
|
|
|
|
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
|
|
|
|
if: success() && !env.SKIP_JOB
|
2023-06-07 23:20:39 +00:00
|
|
|
- name: create github artifacts
|
|
|
|
run: src/ci/scripts/create-doc-artifacts.sh
|
|
|
|
if: success() && !env.SKIP_JOB
|
|
|
|
- name: upload artifacts to github
|
2024-03-23 16:06:02 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-06-07 23:20:39 +00:00
|
|
|
with:
|
|
|
|
name: "${{ env.DOC_ARTIFACT_NAME }}"
|
|
|
|
path: obj/artifacts/doc
|
|
|
|
if-no-files-found: ignore
|
|
|
|
retention-days: 5
|
|
|
|
if: success() && !env.SKIP_JOB
|
2019-11-26 11:06:30 +00:00
|
|
|
- name: upload artifacts to S3
|
|
|
|
run: src/ci/scripts/upload-artifacts.sh
|
|
|
|
env:
|
|
|
|
AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
|
|
|
|
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
|
|
|
|
if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
|
|
|
|
master:
|
|
|
|
name: master
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2020-07-20 15:43:48 +00:00
|
|
|
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"
|
2019-11-26 11:06:30 +00:00
|
|
|
TOOLSTATE_PUBLISH: 1
|
2020-07-20 15:43:48 +00:00
|
|
|
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZI5DHEBFL
|
|
|
|
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZN24CBO55
|
2023-04-30 20:23:48 +00:00
|
|
|
AWS_REGION: us-west-1
|
2020-07-20 15:43:48 +00:00
|
|
|
CACHE_DOMAIN: ci-caches.rust-lang.org
|
2020-03-20 15:46:45 +00:00
|
|
|
if: "github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'rust-lang-ci/rust'"
|
2019-11-26 11:06:30 +00:00
|
|
|
steps:
|
|
|
|
- name: checkout the source code
|
2023-09-08 05:18:21 +00:00
|
|
|
uses: actions/checkout@v4
|
2019-11-26 11:06:30 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
|
|
|
- name: publish toolstate
|
|
|
|
run: src/ci/publish_toolstate.sh
|
2020-07-16 17:47:37 +00:00
|
|
|
shell: bash
|
2019-11-26 11:06:30 +00:00
|
|
|
env:
|
|
|
|
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
|
|
|
|
if: success() && !env.SKIP_JOB
|
|
|
|
try-success:
|
|
|
|
needs:
|
2024-04-20 07:07:11 +00:00
|
|
|
- job
|
2020-07-21 18:53:39 +00:00
|
|
|
if: "success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
|
2019-11-26 11:06:30 +00:00
|
|
|
steps:
|
|
|
|
- name: mark the job as a success
|
|
|
|
run: exit 0
|
2020-04-29 14:32:06 +00:00
|
|
|
shell: bash
|
2019-11-26 11:06:30 +00:00
|
|
|
name: bors build finished
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
try-failure:
|
|
|
|
needs:
|
2024-04-20 07:07:11 +00:00
|
|
|
- job
|
2020-07-21 18:53:39 +00:00
|
|
|
if: "!success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
|
2019-11-26 11:06:30 +00:00
|
|
|
steps:
|
|
|
|
- name: mark the job as a failure
|
|
|
|
run: exit 1
|
2020-04-29 14:32:06 +00:00
|
|
|
shell: bash
|
2019-11-26 11:06:30 +00:00
|
|
|
name: bors build finished
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
auto-success:
|
|
|
|
needs:
|
2024-04-20 07:42:23 +00:00
|
|
|
- job
|
2020-03-20 17:28:47 +00:00
|
|
|
if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
|
2019-11-26 11:06:30 +00:00
|
|
|
steps:
|
|
|
|
- name: mark the job as a success
|
|
|
|
run: exit 0
|
2020-04-29 14:32:06 +00:00
|
|
|
shell: bash
|
2019-11-26 11:06:30 +00:00
|
|
|
name: bors build finished
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
auto-failure:
|
|
|
|
needs:
|
2024-04-20 07:42:23 +00:00
|
|
|
- job
|
2020-03-20 17:28:47 +00:00
|
|
|
if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
|
2019-11-26 11:06:30 +00:00
|
|
|
steps:
|
|
|
|
- name: mark the job as a failure
|
|
|
|
run: exit 1
|
2020-04-29 14:32:06 +00:00
|
|
|
shell: bash
|
2019-11-26 11:06:30 +00:00
|
|
|
name: bors build finished
|
|
|
|
runs-on: ubuntu-latest
|