Skip to content

Commit

Permalink
chore: add gnullvm cross check to the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mati865 authored and nagisa committed Nov 13, 2024
1 parent 762438e commit bdb1a18
Showing 1 changed file with 56 additions and 20 deletions.
76 changes: 56 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
branches:
- master
paths-ignore:
- '*.mkd'
- 'LICENSE'
- "*.mkd"
- "LICENSE"
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
Expand All @@ -20,8 +20,8 @@ jobs:
matrix:
rust_toolchain: [nightly, stable, 1.63.0]
os: [ubuntu-latest, windows-latest, macOS-latest]
mode: ['--release', '-Zminimal-versions', '']
manifest: ['psm/Cargo.toml', 'Cargo.toml']
mode: ["--release", "-Zminimal-versions", ""]
manifest: ["psm/Cargo.toml", "Cargo.toml"]
exclude:
- rust_toolchain: stable
mode: -Zminimal-versions
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
strategy:
fail-fast: false
matrix:
manifest: ['psm/Cargo.toml', 'Cargo.toml']
manifest: ["psm/Cargo.toml", "Cargo.toml"]
rust_target:
- x86_64-pc-windows-msvc
- i686-pc-windows-msvc
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
rust_target:
- x86_64-pc-windows-gnu
- i686-pc-windows-gnu
manifest: ['psm/Cargo.toml', 'Cargo.toml']
manifest: ["psm/Cargo.toml", "Cargo.toml"]
include:
- rust_target: x86_64-pc-windows-gnu
mingw_path: C:/msys64/mingw64/bin
Expand Down Expand Up @@ -121,6 +121,42 @@ jobs:
command: test
args: --target ${{ matrix.rust_target }} --manifest-path=${{ matrix.manifest }}

cross-windows-gnullvm-check:
name: Check ${{ matrix.manifest }} to ${{ matrix.rust_target }} with stable
runs-on: ubuntu-latest
env:
LLVM_MINGW_VERSION: "20241030"
strategy:
fail-fast: false
matrix:
rust_target:
- aarch64-pc-windows-gnullvm
- i686-pc-windows-gnullvm
- x86_64-pc-windows-gnullvm
manifest: ["psm/Cargo.toml", "Cargo.toml"]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: llvm-mingw-version
key: ${{ env.LLVM_MINGW_VERSION }}
- name: Install llvm-mingw
if: steps.cache.outputs.cache-hit != 'true'
run: curl -L https://github.com/mstorsjo/llvm-mingw/releases/download/${{ env.LLVM_MINGW_VERSION }}/llvm-mingw-${{ env.LLVM_MINGW_VERSION }}-ucrt-ubuntu-20.04-x86_64.tar.xz | tar xJf -
- name: Add llvm-mingw to PATH
run: echo "${{ github.workspace }}/llvm-mingw-${{ env.LLVM_MINGW_VERSION }}-ucrt-ubuntu-20.04-x86_64/bin" >> $GITHUB_PATH
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
target: ${{ matrix.rust_target }}
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --target ${{ matrix.rust_target }} --manifest-path=${{ matrix.manifest }}

cross-linux-test:
name: Test ${{ matrix.manifest }} on ${{ matrix.rust_target }} with nightly ${{ matrix.mode }}
runs-on: ubuntu-latest
Expand All @@ -147,8 +183,8 @@ jobs:
# https://github.com/rust-embedded/cross/pull/440
# - powerpc64-unknown-linux-gnu
- x86_64-unknown-linux-musl
manifest: ['psm/Cargo.toml', 'Cargo.toml']
mode: ['--release', '-Zminimal-versions', '']
manifest: ["psm/Cargo.toml", "Cargo.toml"]
mode: ["--release", "-Zminimal-versions", ""]
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -176,7 +212,7 @@ jobs:
# BSDs: could be tested with full system emulation
- i686-unknown-freebsd
- x86_64-unknown-freebsd
manifest: ['psm/Cargo.toml', 'Cargo.toml']
manifest: ["psm/Cargo.toml", "Cargo.toml"]
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -215,7 +251,7 @@ jobs:
# - sparc64-unknown-linux-gnu
# BSDs: could be tested with full system emulation
- x86_64-unknown-netbsd
manifest: ['psm/Cargo.toml', 'Cargo.toml']
manifest: ["psm/Cargo.toml", "Cargo.toml"]
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -243,7 +279,7 @@ jobs:
rust_target:
- aarch64-apple-ios
- x86_64-apple-ios
manifest: ['psm/Cargo.toml', 'Cargo.toml']
manifest: ["psm/Cargo.toml", "Cargo.toml"]
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
Expand All @@ -269,8 +305,8 @@ jobs:
rust_target:
- x86_64-pc-windows-msvc
- i686-pc-windows-msvc
manifest: ['psm/Cargo.toml', 'Cargo.toml']
xwin_version: ['0.1.6']
manifest: ["psm/Cargo.toml", "Cargo.toml"]
xwin_version: ["0.1.6"]
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -299,17 +335,17 @@ jobs:
xwin --accept-license 1 splat --output /tmp/xwin
- name: Test
env:
CC: 'clang-cl'
CXX: 'clang-cl'
AR: 'llvm-lib'
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER: 'lld-link'
CARGO_TARGET_I686_PC_WINDOWS_MSVC_LINKER: 'lld-link'
CC: "clang-cl"
CXX: "clang-cl"
AR: "llvm-lib"
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER: "lld-link"
CARGO_TARGET_I686_PC_WINDOWS_MSVC_LINKER: "lld-link"
# Note that we only disable unused-command-line-argument here since clang-cl
# doesn't implement all of the options supported by cl, but the ones it doesn't
# are _generally_ not interesting.
CFLAGS: '-Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/tmp/xwin/crt/include /imsvc/tmp/xwin/sdk/include/ucrt /imsvc/tmp/xwin/sdk/include/um /imsvc/tmp/xwin/sdk/include/shared'
CFLAGS: "-Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/tmp/xwin/crt/include /imsvc/tmp/xwin/sdk/include/ucrt /imsvc/tmp/xwin/sdk/include/um /imsvc/tmp/xwin/sdk/include/shared"
# Inform the linker where to search for libraries
RUSTFLAGS: '-Lnative=/tmp/xwin/crt/lib/x86_64 -Lnative=/tmp/xwin/sdk/lib/um/x86_64 -Lnative=/tmp/xwin/sdk/lib/ucrt/x86_64'
RUSTFLAGS: "-Lnative=/tmp/xwin/crt/lib/x86_64 -Lnative=/tmp/xwin/sdk/lib/um/x86_64 -Lnative=/tmp/xwin/sdk/lib/ucrt/x86_64"
run: |
set -eux
cargo build --target ${{ matrix.rust_target }} --manifest-path ${{ matrix.manifest }}
Expand Down

0 comments on commit bdb1a18

Please sign in to comment.