Mark Encoder as Send + Sync to enable multithreaded use #29
Workflow file for this run
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: | |
- master | |
paths: | |
- '.github/workflows/rust.yml' | |
- 'src/**.rs' | |
- 'tests/**' | |
- 'Cargo.toml' | |
- 'valgrind.supp' | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
branches: | |
- '**' | |
paths: | |
- '.github/workflows/rust.yml' | |
- 'src/**.rs' | |
- 'tests/**' | |
- 'Cargo.toml' | |
- 'valgrind.supp' | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install Rust Unix | |
if: runner.os != 'Windows' | |
run: | | |
if rustup --version >/dev/null 2>&1; then | |
rustup update | |
else | |
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable | |
echo ::add-path::$HOME/.cargo/bin | |
fi | |
- name: Install Rust Windows | |
if: runner.os == 'Windows' | |
run: | | |
if (Get-Command "rustup" -ErrorAction SilentlyContinue) { | |
rustup update | |
} else { | |
Invoke-WebRequest https://static.rust-lang.org/rustup/dist/i686-pc-windows-gnu/rustup-init.exe -OutFile rustup-init.exe | |
./rustup-init.exe -y --profile minimal --default-toolchain stable | |
echo ::add-path::%USERPROFILE%\.cargo\bin | |
} | |
- name: Install Valgrind | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y valgrind | |
- name: Rust version | |
run: | | |
cargo --version | |
rustc --version | |
- name: Check | |
run: cargo test | |
- name: Valgrind Check | |
if: runner.os == 'Linux' | |
env: | |
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: "valgrind --leak-check=full --error-exitcode=1 --gen-suppressions=all --suppressions=valgrind.supp" | |
run: cargo test --release | |
cross-compilation-test: | |
needs: test | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
strategy: | |
matrix: | |
target: ["aarch64-unknown-linux-musl", "aarch64-unknown-linux-gnu", "arm-unknown-linux-musleabi"] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install Rust Unix | |
run: | | |
if rustup --version >/dev/null 2>&1; then | |
rustup update | |
else | |
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable | |
echo ::add-path::$HOME/.cargo/bin | |
fi | |
- name: Install Cross | |
run: | | |
curl -L https://github.com/cross-rs/cross/releases/download/v0.2.4/cross-x86_64-unknown-linux-musl.tar.gz | tar xfz - | |
cp cross $HOME/.cargo/bin | |
- name: Check ${{ matrix.target }} | |
run: cross check |