Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update runners for macOS-related workflows #3681

Merged
merged 2 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 127 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ jobs:
strategy:
fail-fast: false
matrix:
target:
- x86_64-pc-windows-msvc
mode:
- dev
- release
target:
- x86_64-pc-windows-msvc
include:
- target: x86_64-pc-windows-msvc
run_tests: YES
Expand Down Expand Up @@ -160,13 +160,13 @@ jobs:
strategy:
fail-fast: false
matrix:
mode:
- dev
- release
target:
- x86_64-pc-windows-msvc
- aarch64-pc-windows-msvc # skip-pr
- x86_64-pc-windows-gnu # skip-pr
mode:
- dev
- release
include:
- target: x86_64-pc-windows-msvc
run_tests: YES
Expand Down Expand Up @@ -297,15 +297,15 @@ jobs:
strategy:
fail-fast: false
matrix:
mode:
- dev
- release
target:
- x86_64-pc-windows-msvc
- i686-pc-windows-msvc # skip-pr skip-master
- aarch64-pc-windows-msvc # skip-pr
- x86_64-pc-windows-gnu # skip-pr
- i686-pc-windows-gnu # skip-pr skip-master
mode:
- dev
- release
include:
- target: x86_64-pc-windows-msvc
run_tests: YES
Expand Down Expand Up @@ -895,19 +895,15 @@ jobs:

# This is ci/actions-templates/macos-builds-template.yaml
# Do not edit this file in .github/workflows
build-macos: # job-name
runs-on: macos-latest
build-macos-x86_64: # job-name skip-aarch64
runs-on: macos-13 # skip-aarch64
strategy:
matrix:
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
mode:
- dev
- release
include:
- target: x86_64-apple-darwin
run_tests: YES
target:
- x86_64-apple-darwin # skip-aarch64
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -930,7 +926,7 @@ jobs:
echo "SKIP_TESTS=" >> $GITHUB_ENV
echo "LZMA_API_STATIC=1" >> $GITHUB_ENV
- name: Skip tests
if: matrix.run_tests == '' || matrix.mode == 'release'
if: matrix.mode == 'release'
run: |
echo "SKIP_TESTS=yes" >> $GITHUB_ENV
- name: Cache cargo registry and git trees
Expand Down Expand Up @@ -960,12 +956,119 @@ jobs:
rustup toolchain uninstall stable
fi
rustup toolchain install --profile=minimal stable
- name: aarch64-specific items
- name: Ensure we have our goal target installed
run: |
rustup target install "$TARGET"
- name: Run a full build and test
env:
BUILD_PROFILE: ${{ matrix.mode }}
run: bash ci/run.bash
- name: Dump dynamic link targets
if: matrix.mode == 'release'
run: |
otool -L target/${TARGET}/release/rustup-init
if otool -L target/${TARGET}/release/rustup-init | grep -q -F /usr/local/; then
echo >&2 "Unfortunately there are /usr/local things in the link. Fail."
exit 1
fi
- name: Upload the built artifact
if: matrix.mode == 'release'
uses: actions/upload-artifact@v4
with:
name: rustup-init-${{ matrix.target }}
path: |
target/${{ matrix.target }}/release/rustup-init
retention-days: 7
- name: Acquire the AWS tooling
if: github.event_name == 'push' && github.ref == 'refs/heads/stable' && matrix.mode == 'release'
run: |
# Use nightly for now
rustup toolchain install --profile=minimal nightly
rustup default nightly
if: matrix.target == 'aarch64-apple-darwin'
pip3 install awscli
- name: Prepare the dist
if: github.event_name == 'push' && github.ref == 'refs/heads/stable' && matrix.mode == 'release'
run: |
bash ci/prepare-deploy.bash
- name: Deploy build to dev-static dist tree for release team
if: github.event_name == 'push' && github.ref == 'refs/heads/stable' && matrix.mode == 'release'
run: |
aws s3 cp --recursive deploy/ s3://dev-static-rust-lang-org/rustup/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-1
- name: Clear the cargo caches
run: |
cargo install cargo-cache --no-default-features --features ci-autoclean
cargo-cache
- name: Flush cache
# This is a workaround for a bug with GitHub Actions Cache that causes
# corrupt cache entries (particularly in the target directory). See
# https://github.com/actions/cache/issues/403 and
# https://github.com/rust-lang/cargo/issues/8603.
run: sudo /usr/sbin/purge

# This is ci/actions-templates/macos-builds-template.yaml
# Do not edit this file in .github/workflows
build-macos-aarch64: # job-name skip-x86_64
runs-on: macos-14 # skip-x86_64
strategy:
matrix:
mode:
- dev
- release
target:
- aarch64-apple-darwin # skip-x86_64
steps:
- uses: actions/checkout@v4
with:
# v2 defaults to a shallow checkout, but we need at least to the previous tag
fetch-depth: 0
- name: Acquire tags for the repo
run: |
git fetch --no-tags --prune --depth=1 origin +refs/tags/*:refs/tags/*
- name: Display the current git status
run: |
git status
git describe
- name: Prep cargo dirs
run: |
mkdir -p ~/.cargo/{registry,git}
- name: Set environment variables appropriately for the build
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
echo "TARGET=${{ matrix.target }}" >> $GITHUB_ENV
echo "SKIP_TESTS=" >> $GITHUB_ENV
echo "LZMA_API_STATIC=1" >> $GITHUB_ENV
- name: Skip tests
if: matrix.mode == 'release'
run: |
echo "SKIP_TESTS=yes" >> $GITHUB_ENV
- name: Cache cargo registry and git trees
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Get rustc commit hash
id: cargo-target-cache
run: |
echo "{rust_hash}={$(rustc -Vv | grep commit-hash | awk '{print $2}')}" >> $GITHUB_OUTPUT
shell: bash
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ github.base_ref }}-${{ github.head_ref }}-${{ matrix.target }}-${{ matrix.mode }}-cargo-target-dir-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ github.base_ref }}-${{ matrix.target }}-${{ matrix.mode }}-cargo-target-dir-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rustup using ./rustup-init.sh
run: |
sh ./rustup-init.sh --default-toolchain=none --profile=minimal -y
- name: Ensure Stable is up to date
run: |
if rustc +stable -vV >/dev/null 2>/dev/null; then
rustup toolchain uninstall stable
fi
rustup toolchain install --profile=minimal stable
- name: Ensure we have our goal target installed
run: |
rustup target install "$TARGET"
Expand Down Expand Up @@ -1218,7 +1321,8 @@ jobs:
- build-linux-pr
- build-linux-master
- build-linux-stable
- build-macos
- build-macos-aarch64
- build-macos-x86_64
- doc
- build-windows-pr
- build-windows-master
Expand Down
4 changes: 3 additions & 1 deletion ci/actions-templates/gen-workflows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ gen_job linux-builds pr
gen_job linux-builds master
gen_job linux-builds stable

gen_job macos-builds x86_64
gen_job macos-builds aarch64

# The following targets only have a single job
gen_job macos-builds all
gen_job freebsd-builds all
gen_job centos-fmt-clippy all
gen_job all-features all
Expand Down
25 changes: 9 additions & 16 deletions ci/actions-templates/macos-builds-template.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
jobs: # skip-all
jobs: # skip-x86_64 skip-aarch64

# This is ci/actions-templates/macos-builds-template.yaml
# Do not edit this file in .github/workflows
build-macos: # job-name
runs-on: macos-latest
build-macos-aarch64: # job-name skip-x86_64
runs-on: macos-14 # skip-x86_64
build-macos-x86_64: # job-name skip-aarch64
runs-on: macos-13 # skip-aarch64
strategy:
matrix:
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
mode:
- dev
- release
include:
- target: x86_64-apple-darwin
run_tests: YES
target:
- x86_64-apple-darwin # skip-aarch64
- aarch64-apple-darwin # skip-x86_64
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -37,7 +36,7 @@ jobs: # skip-all
echo "SKIP_TESTS=" >> $GITHUB_ENV
echo "LZMA_API_STATIC=1" >> $GITHUB_ENV
- name: Skip tests
if: matrix.run_tests == '' || matrix.mode == 'release'
if: matrix.mode == 'release'
run: |
echo "SKIP_TESTS=yes" >> $GITHUB_ENV
- name: Cache cargo registry and git trees
Expand Down Expand Up @@ -67,12 +66,6 @@ jobs: # skip-all
rustup toolchain uninstall stable
fi
rustup toolchain install --profile=minimal stable
- name: aarch64-specific items
run: |
# Use nightly for now
rustup toolchain install --profile=minimal nightly
rustup default nightly
if: matrix.target == 'aarch64-apple-darwin'
- name: Ensure we have our goal target installed
run: |
rustup target install "$TARGET"
Expand Down
6 changes: 3 additions & 3 deletions ci/actions-templates/windows-builds-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs: # skip-master skip-pr skip-stable
strategy:
fail-fast: false
matrix:
mode:
- dev
- release
target:
- x86_64-pc-windows-msvc
- i686-pc-windows-msvc # skip-pr skip-master
- aarch64-pc-windows-msvc # skip-pr
- x86_64-pc-windows-gnu # skip-pr
- i686-pc-windows-gnu # skip-pr skip-master
mode:
- dev
- release
include:
- target: x86_64-pc-windows-msvc
run_tests: YES
Expand Down
Loading