fix: use Path fro Unix and str for Windows #9
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: Rust | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
- target: x86_64-unknown-linux-musl | |
os: ubuntu-latest | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.target }} | |
env: | |
CARGO_BUILD_TARGET: ${{ matrix.target }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install host target | |
if: "!matrix.use-cross" | |
run: rustup target add ${{ matrix.target }} | |
- name: Install musl-tools | |
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} | |
run: sudo apt-get update && sudo apt-get install -y musl-tools | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build --verbose --target ${{ matrix.target }} | |
- name: Run tests | |
run: cargo test --verbose --target ${{ matrix.target }} | |
- name: Run sample | |
run: cargo run --package copy_on_write --bin copy_on_write --target ${{ matrix.target }} |