From 9ceae02d2459bd66ac1bcda3d4bee864fe703489 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Thu, 4 Jul 2024 12:07:10 -0700 Subject: [PATCH] Try windows --- .github/workflows/ci.yml | 162 +++++++++++++++++++++------------------ 1 file changed, 87 insertions(+), 75 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4cf0e5fba5378..09b8d14540b08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: - "**" @@ -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: @@ -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/setup-msys2@v2.22.0 @@ -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 @@ -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 @@ -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