Merge pull request #74 from bact/remove-unused-code #252
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: Test main lib (Rust crate) | |
on: | |
push: | |
branches: | |
- main | |
# paths: | |
# - 'src/**' | |
# - 'Cargo.toml' | |
# - 'tests/**' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'src/**' | |
- 'tests/**' | |
- 'Cargo.toml' | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest, self-hosted] | |
bitness: [64] # 32, 64 | |
include: | |
- os: windows-latest | |
bitness: 32 | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@master | |
- name: Setup Rust toolchain - non-win32 | |
uses: actions-rs/toolchain@v1 | |
with: | |
override: true | |
profile: minimal | |
toolchain: stable | |
if: ${{ !startsWith(matrix.os, 'windows') || matrix.bitness != '32' }} | |
- name: Setup Rust toolchain - win32 | |
uses: actions-rs/toolchain@v1 | |
with: | |
override: true | |
profile: minimal | |
toolchain: stable | |
target: i686-pc-windows-msvc | |
if: startsWith(matrix.os, 'windows') && matrix.bitness == '32' | |
- name: Setup Rust dependencies | |
uses: ATiltedTree/setup-rust@v1 | |
with: | |
rust-version: 1.65.0 | |
- name: Cache Rust files | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ matrix.os }}-${{ matrix.bitness }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ matrix.os }}-${{ matrix.bitness }}-cargo- | |
- name: Test | |
run: cargo test |