ci-test #1780
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "ci-test" | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- main | |
merge_group: | |
schedule: | |
- cron: "00 05 * * *" | |
jobs: | |
test: | |
name: test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
build: [ubuntu-stable, macos-stable, win-msvc-stable] # win-gnu-stable | |
include: | |
- build: ubuntu-stable | |
os: ubuntu-latest | |
rust: stable | |
- build: macos-stable | |
os: macos-13 | |
rust: stable | |
# FIXME: This is currently broken, see below. | |
# * https://github.com/foresterre/cargo-msrv/pull/842 | |
# * https://github.com/rust-lang/rust/issues/112368 | |
# - build: win-gnu-stable | |
# os: windows-latest | |
# rust: stable-x86_64-gnu | |
- build: win-msvc-stable | |
os: windows-latest | |
rust: stable | |
steps: | |
- name: checkout_repository | |
uses: actions/checkout@v4 | |
# We would prefer to use `dtolnay/rust-toolchain@master with toolchain=${{ matrix.rust }}` or `rustup update ${{ matrix.rust }}`. | |
# However, when using either we run into a linking issue: | |
# `error: could not create link from 'C:\\Users\\runneradmin\\.cargo\\bin\\rustup.exe' to 'C:\\Users\\runneradmin\\.cargo\\bin\\cargo.exe'\n" })', tests\find_msrv.rs:156:39` | |
# I find the message odd, because we only need to install the toolchain, not set it as the default, and replace the | |
# binary; so what is meant by "link" in the above error? | |
- name: install_rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
override: true | |
profile: minimal | |
target: x86_64-unknown-linux-musl | |
- name: fetch | |
run: cargo fetch --verbose | |
- name: build | |
run: cargo build --verbose | |
- name: install musl-gcc | |
if: matrix.os == 'ubuntu-latest' | |
uses: awalsh128/cache-apt-pkgs-action@v1 | |
with: | |
packages: musl-tools # provides musl-gcc | |
version: 1.0 | |
- name: build using musl | |
if: matrix.os == 'ubuntu-latest' | |
run: cargo build --verbose --target=x86_64-unknown-linux-musl | |
- name: test_all | |
run: cargo test --verbose --all -- --test-threads=1 |