Finalize 1.0.1 #199
Workflow file for this run
This file contains hidden or 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: Rust | |
on: | |
pull_request: | |
branches: | |
- "*" | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
info: | |
- { | |
os: "ubuntu-latest", | |
target: "x86_64-unknown-linux-gnu", | |
cross: false, | |
} | |
- { | |
os: "ubuntu-latest", | |
target: "x86_64-unknown-linux-musl", | |
cross: true, | |
} | |
# - { os: "macOS-latest", target: "x86_64-apple-darwin", cross: false } | |
# - { os: "macOS-latest", target: "aarch64-apple-darwin", cross: false } | |
- { | |
os: "windows-latest", | |
target: "x86_64-pc-windows-msvc", | |
cross: false, | |
} | |
- { | |
os: "windows-latest", | |
target: "i686-pc-windows-msvc", | |
cross: true, | |
} | |
runs-on: ${{ matrix.info.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Rust toolchain | |
if: ${{ steps.skip_check.outputs.should_skip != 'true' }} | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
targets: ${{ matrix.info.target }} | |
- name: Enable Rust cache | |
if: ${{ steps.skip_check.outputs.should_skip != 'true' }} | |
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f #2.1.0 | |
- name: Fmt Check | |
run: cargo fmt -- --check | |
- name: Prepare Clippy | |
run: rustup component add clippy | |
- name: Run clippy action to produce annotations | |
run: cargo clippy --all-targets -- -D warnings | |
- name: Install dependencies for musl | |
if: matrix.info.os == 'ubuntu-latest' && matrix.info.cross == true | |
run: | | |
sudo apt update | |
sudo apt install -y musl-tools libssl-dev pkg-config | |
- name: Install cross | |
if: matrix.info.os == 'ubuntu-latest' && matrix.info.cross == true | |
run: cargo install cross --git https://github.com/cross-rs/cross | |
- name: Build tests | |
if: ${{ steps.skip_check.outputs.should_skip != 'true' }} | |
uses: ClementTsang/[email protected] | |
with: | |
command: test | |
args: --no-run --locked ${{ matrix.features }} --target=${{ matrix.info.target }} | |
use-cross: ${{ matrix.info.cross }} | |
cross-version: 0.2.4 | |
env: | |
RUST_BACKTRACE: full | |
OPENSSL_STATIC: "1" | |
PKG_CONFIG_ALLOW_CROSS: "1" | |
- name: Run tests | |
env: | |
RUST_TEST_THREADS: 1 | |
run: cargo test --verbose |