Skip to content

Commit

Permalink
Try windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Jul 4, 2024
1 parent 9f877c9 commit 9ceae02
Showing 1 changed file with 87 additions and 75 deletions.
162 changes: 87 additions & 75 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
name: CI
on:
push:
branches:
- auto
- try
- try-perf
- automation/bors/try
# branches:
# - auto
# - try
# - try-perf
# - automation/bors/try
pull_request:
branches:
- "**"
Expand Down Expand Up @@ -44,23 +44,23 @@ jobs:
# The job matrix for `calculate_matrix` is defined in src/ci/github-actions/jobs.yml.
# It calculates which jobs should be executed, based on the data of the ${{ github }} context.
# If you want to modify CI jobs, take a look at src/ci/github-actions/jobs.yml.
calculate_matrix:
name: Calculate job matrix
runs-on: ubuntu-latest
outputs:
jobs: ${{ steps.jobs.outputs.jobs }}
run_type: ${{ steps.jobs.outputs.run_type }}
steps:
- name: Checkout the source code
uses: actions/checkout@v4
- name: Calculate the CI job matrix
env:
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: python3 src/ci/github-actions/calculate-job-matrix.py >> $GITHUB_OUTPUT
id: jobs
# calculate_matrix:
# name: Calculate job matrix
# runs-on: ubuntu-latest
# outputs:
# jobs: ${{ steps.jobs.outputs.jobs }}
# run_type: ${{ steps.jobs.outputs.run_type }}
# steps:
# - name: Checkout the source code
# uses: actions/checkout@v4
# - name: Calculate the CI job matrix
# env:
# COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
# run: python3 src/ci/github-actions/calculate-job-matrix.py >> $GITHUB_OUTPUT
# id: jobs
job:
name: ${{ matrix.name }}
needs: [ calculate_matrix ]
# needs: [ calculate_matrix ]
runs-on: "${{ matrix.os }}"
defaults:
run:
Expand All @@ -78,7 +78,19 @@ jobs:
strategy:
matrix:
# Check the `calculate_matrix` job to see how is the matrix defined.
include: ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }}
include:
- image: x86_64-msvc-ext
name: x86_64-msvc-ext
os: windows-2022
env:
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZN24CBO55
AWS_REGION: us-west-1
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZI5DHEBFL
DEPLOY_BUCKET: rust-lang-ci2
DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
HOST_TARGET: x86_64-pc-windows-msvc
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-lld --save-toolstates=/tmp/toolstate/toolstates.json
SCRIPT: python x.py --stage 2 test src/tools/cargotest src/tools/cargo && src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstate/toolstates.json windows
steps:
- if: contains(matrix.os, 'windows')
uses: msys2/[email protected]
Expand Down Expand Up @@ -107,11 +119,11 @@ jobs:
# 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: needs.calculate_matrix.outputs.run_type == 'pr'
# - name: configure the PR in which the error message will be posted
# run: echo "[CI_PR_NUMBER=$num]"
# env:
# num: ${{ github.event.number }}
# if: needs.calculate_matrix.outputs.run_type == 'pr'

- name: add extra environment variables
run: src/ci/scripts/setup-environment.sh
Expand All @@ -122,8 +134,8 @@ jobs:
# which then uses log commands to actually set them.
EXTRA_VARIABLES: ${{ toJson(matrix.env) }}

- name: ensure the channel matches the target branch
run: src/ci/scripts/verify-channel.sh
# - name: ensure the channel matches the target branch
# run: src/ci/scripts/verify-channel.sh

- name: collect CPU statistics
run: src/ci/scripts/collect-cpu-stats.sh
Expand Down Expand Up @@ -188,53 +200,53 @@ jobs:
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)] }}

- name: create github artifacts
run: src/ci/scripts/create-doc-artifacts.sh

- name: upload artifacts to github
uses: actions/upload-artifact@v4
with:
# name is set in previous step
name: ${{ env.DOC_ARTIFACT_NAME }}
path: obj/artifacts/doc
if-no-files-found: ignore
retention-days: 5

- 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)] }}
# Adding a condition on DEPLOY=1 or DEPLOY_ALT=1 is not needed as all deploy
# builders *should* have the AWS credentials available. Still, explicitly
# adding the condition is helpful as this way CI will not silently skip
# deploying artifacts from a dist builder if the variables are misconfigured,
# erroring about invalid credentials instead.
if: github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1'
# - name: create github artifacts
# run: src/ci/scripts/create-doc-artifacts.sh

# - name: upload artifacts to github
# uses: actions/upload-artifact@v4
# with:
# # name is set in previous step
# name: ${{ env.DOC_ARTIFACT_NAME }}
# path: obj/artifacts/doc
# if-no-files-found: ignore
# retention-days: 5

# - 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)] }}
# # Adding a condition on DEPLOY=1 or DEPLOY_ALT=1 is not needed as all deploy
# # builders *should* have the AWS credentials available. Still, explicitly
# # adding the condition is helpful as this way CI will not silently skip
# # deploying artifacts from a dist builder if the variables are misconfigured,
# # erroring about invalid credentials instead.
# if: github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1'

# This job isused to tell bors the final status of the build, as there is no practical way to detect
# when a workflow is successful listening to webhooks only in our current bors implementation (homu).
outcome:
name: bors build finished
runs-on: ubuntu-latest
needs: [ calculate_matrix, job ]
# !cancelled() executes the job regardless of whether the previous jobs passed or failed
if: ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }}
steps:
- name: checkout the source code
uses: actions/checkout@v4
with:
fetch-depth: 2
# Calculate the exit status of the whole CI workflow.
# If all dependent jobs were successful, this exits with 0 (and the outcome job continues successfully).
# If a some dependent job has failed, this exits with 1.
- name: calculate the correct exit status
run: jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'
# Publish the toolstate if an auto build succeeds (just before push to master)
- name: publish toolstate
run: src/ci/publish_toolstate.sh
shell: bash
if: needs.calculate_matrix.outputs.run_type == 'auto'
env:
TOOLSTATE_ISSUES_API_URL: https://api.github.com/repos/rust-lang/rust/issues
TOOLSTATE_PUBLISH: 1
# outcome:
# name: bors build finished
# runs-on: ubuntu-latest
# needs: [ calculate_matrix, job ]
# # !cancelled() executes the job regardless of whether the previous jobs passed or failed
# if: ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }}
# steps:
# - name: checkout the source code
# uses: actions/checkout@v4
# with:
# fetch-depth: 2
# # Calculate the exit status of the whole CI workflow.
# # If all dependent jobs were successful, this exits with 0 (and the outcome job continues successfully).
# # If a some dependent job has failed, this exits with 1.
# - name: calculate the correct exit status
# run: jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'
# # Publish the toolstate if an auto build succeeds (just before push to master)
# - name: publish toolstate
# run: src/ci/publish_toolstate.sh
# shell: bash
# if: needs.calculate_matrix.outputs.run_type == 'auto'
# env:
# TOOLSTATE_ISSUES_API_URL: https://api.github.com/repos/rust-lang/rust/issues
# TOOLSTATE_PUBLISH: 1

0 comments on commit 9ceae02

Please sign in to comment.