Skip to content

Commit

Permalink
ci: fix matrix usage
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtwco committed Nov 6, 2024
1 parent 74773fe commit a3928c4
Showing 1 changed file with 97 additions and 93 deletions.
190 changes: 97 additions & 93 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,122 +65,126 @@ jobs:
test:
needs: [style]
name: Test
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.target.os }}
strategy:
matrix:
profile:
- dev
- release
target:
# Dockers that are run through docker on linux
- i686-unknown-linux-gnu
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-gnu-emulated
- arm-unknown-linux-gnueabihf
- armv7-unknown-linux-gnueabihf
- aarch64-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
- tuple: i686-unknown-linux-gnu
os: ubuntu-latest
- tuple: x86_64-unknown-linux-gnu
os: ubuntu-latest
- tuple: x86_64-unknown-linux-gnu-emulated
os: ubuntu-latest
- tuple: arm-unknown-linux-gnueabihf
os: ubuntu-latest
- tuple: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
- tuple: aarch64-unknown-linux-gnu
os: ubuntu-latest
- tuple: riscv64gc-unknown-linux-gnu
os: ubuntu-latest
- tuple: powerpc64le-unknown-linux-gnu
os: ubuntu-latest
# MIPS targets disabled since they are dropped to tier 3.
# See https://github.com/rust-lang/compiler-team/issues/648
#- mips-unknown-linux-gnu
#- mips64-unknown-linux-gnuabi64
#- mips64el-unknown-linux-gnuabi64
#- mipsel-unknown-linux-musl
- s390x-unknown-linux-gnu
- wasm32-wasip1
- i586-unknown-linux-gnu
- nvptx64-nvidia-cuda
- thumbv6m-none-eabi
- thumbv7m-none-eabi
- thumbv7em-none-eabi
- thumbv7em-none-eabihf
- loongarch64-unknown-linux-gnu
- tuple: s390x-unknown-linux-gnu
os: ubuntu-latest
- tuple: i586-unknown-linux-gnu
os: ubuntu-latest
- tuple: nvptx64-nvidia-cuda
os: ubuntu-latest
- tuple: thumbv6m-none-eabi
os: ubuntu-latest
- tuple: thumbv7m-none-eabi
os: ubuntu-latest
- tuple: thumbv7em-none-eabi
os: ubuntu-latest
- tuple: thumbv7em-none-eabihf
os: ubuntu-latest
- tuple: loongarch64-unknown-linux-gnu
os: ubuntu-latest
- tuple: wasm32-wasip1
os: ubuntu-latest

# macOS targets
- x86_64-apple-darwin
- aarch64-apple-darwin
- tuple: x86_64-apple-darwin
os: macos-13
- tuple: x86_64-apple-ios-macabi
os: macos-13
- tuple: aarch64-apple-darwin
os: macos-latest
- tuple: aarch64-apple-ios-macabi
os: macos-latest
# FIXME: gh-actions build environment doesn't have linker support
# - i686-apple-darwin
# - tuple: i686-apple-darwin
# os: macos-13

# Windows targets
- x86_64-pc-windows-msvc
- i686-pc-windows-msvc
- aarch64-pc-windows-msvc
- x86_64-pc-windows-gnu
# - i686-pc-windows-gnu:
- tuple: x86_64-pc-windows-msvc
os: windows-latest
- tuple: i686-pc-windows-msvc
os: windows-latest
- tuple: aarch64-pc-windows-msvc
os: windows-latest
- tuple: x86_64-pc-windows-gnu
os: windows-latest
# - tuple: i686-pc-windows-gnu
# os: windows-latest

# Add additional variables to the matrix variations generated above using `include`:
include:
- target: i686-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-gnu-emulated
os: ubuntu-latest
- target:
tuple: x86_64-unknown-linux-gnu-emulated
os: ubuntu-latest
test_everything: true
rustflags: --cfg stdarch_intel_sde
- target: arm-unknown-linux-gnueabihf
os: ubuntu-latest
- target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
# MIPS targets disabled since they are dropped to tier 3.
# See https://github.com/rust-lang/compiler-team/issues/648
#- target: mips-unknown-linux-gnu
# os: ubuntu-latest
#- target:
# tuple: mips-unknown-linux-gnu
# os: ubuntu-latest
# norun: true
#- target: mips64-unknown-linux-gnuabi64
# os: ubuntu-latest
#- target:
# tuple: mips64-unknown-linux-gnuabi64
# os: ubuntu-latest
# norun: true
#- target: mips64el-unknown-linux-gnuabi64
# os: ubuntu-latest
#- target:
# tuple: mips64el-unknown-linux-gnuabi64
# os: ubuntu-latest
# norun: true
#- target: mipsel-unknown-linux-musl
# os: ubuntu-latest
# norun: 1
- target: powerpc64le-unknown-linux-gnu
os: ubuntu-latest
#- target:
# tuple: mipsel-unknown-linux-musl
# os: ubuntu-latest
# norun: true
- target:
tuple: powerpc64le-unknown-linux-gnu
os: ubuntu-latest
disable_assert_instr: true
- target: s390x-unknown-linux-gnu
os: ubuntu-latest
- target: wasm32-wasip1
os: ubuntu-latest
- target: aarch64-apple-darwin
os: macos-latest
- target:
tuple: aarch64-apple-darwin
os: macos-latest
norun: true # https://github.com/rust-lang/stdarch/issues/1206
- target: aarch64-apple-ios-macabi
os: macos-latest
- target:
tuple: aarch64-apple-ios-macabi
os: macos-latest
norun: true # https://github.com/rust-lang/stdarch/issues/1206
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-13
- target: x86_64-apple-ios-macabi
os: macos-13
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: i686-pc-windows-msvc
os: windows-latest
- target: aarch64-pc-windows-msvc
os: windows-latest
- target:
tuple: aarch64-pc-windows-msvc
os: windows-latest
norun: true
- target:
tuple: x86_64-pc-windows-msvc
os: windows-latest
profile: dev
norun: true
- target: x86_64-pc-windows-gnu
os: windows-latest
- target: i586-unknown-linux-gnu
os: ubuntu-latest
- target: nvptx64-nvidia-cuda
os: ubuntu-latest
- target: thumbv6m-none-eabi
os: ubuntu-latest
- target: thumbv7m-none-eabi
os: ubuntu-latest
- target: thumbv7em-none-eabi
os: ubuntu-latest
- target: thumbv7em-none-eabihf
os: ubuntu-latest
- target: riscv64gc-unknown-linux-gnu
os: ubuntu-latest
- target: loongarch64-unknown-linux-gnu
os: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -191,15 +195,15 @@ jobs:
rustup update nightly --no-self-update
rustup default nightly
- run: rustup target add ${{ matrix.target }}
if: "!endsWith(matrix.target, 'emulated')"
if: "!endsWith(matrix.target.tuple, 'emulated')"
- run: cargo generate-lockfile

# Configure some env vars based on matrix configuration
- run: echo "PROFILE=--profile=${{matrix.profile}}" >> $GITHUB_ENV
shell: bash
- run: echo "NORUN=1" >> $GITHUB_ENV
shell: bash
if: matrix.norun != '' || startsWith(matrix.target, 'thumb') || matrix.target == 'nvptx64-nvidia-cuda'
if: matrix.norun != '' || startsWith(matrix.target.tuple, 'thumb') || matrix.target.tuple == 'nvptx64-nvidia-cuda'
- run: echo "STDARCH_TEST_EVERYTHING=1" >> $GITHUB_ENV
shell: bash
if: matrix.test_everything != ''
Expand All @@ -211,21 +215,21 @@ jobs:
if: matrix.disable_assert_instr != ''
- run: echo "NOSTD=1" >> $GITHUB_ENV
shell: bash
if: startsWith(matrix.target, 'thumb') || matrix.target == 'nvptx64-nvidia-cuda'
if: startsWith(matrix.target.tuple, 'thumb') || matrix.target.tuple == 'nvptx64-nvidia-cuda'

# Windows & OSX go straight to `run.sh` ...
- run: ./ci/run.sh
shell: bash
if: matrix.os != 'ubuntu-latest' || startsWith(matrix.target, 'thumb')
if: matrix.target.os != 'ubuntu-latest' || startsWith(matrix.target.tuple, 'thumb')
env:
TARGET: ${{ matrix.target }}
TARGET: ${{ matrix.target.tuple }}

# ... while Linux goes to `run-docker.sh`
- run: ./ci/run-docker.sh ${{ matrix.target }}
- run: ./ci/run-docker.sh ${{ matrix.target.tuple }}
shell: bash
if: "matrix.os == 'ubuntu-latest' && !startsWith(matrix.target, 'thumb')"
if: "matrix.target.os == 'ubuntu-latest' && !startsWith(matrix.target.tuple, 'thumb')"
env:
TARGET: ${{ matrix.target }}
TARGET: ${{ matrix.target.tuple }}

build-std-detect:
needs: [style]
Expand Down

0 comments on commit a3928c4

Please sign in to comment.