add actions #1
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: Unit Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
RUSTFLAGS: "-C target-cpu=native" | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
compiler: | |
[{ cxx: clang++, c: clang }, { cxx: g++, c: gcc }, { cxx: cl, c: cl }] | |
arch: [{ msvc: 86, gcc: 32 }, { msvc: 64, gcc: 64 }] | |
exclude: | |
- os: windows-latest | |
compiler: { cxx: g++, c: gcc } | |
- os: ubuntu-latest | |
compiler: { cxx: cl, c: cl } | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure env (linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y ninja-build gcc-multilib g++-multilib | |
- name: Configure env (windows) | |
uses: ilammy/msvc-dev-cmd@v1 | |
if: runner.os == 'Windows' | |
with: | |
arch: x${{ matrix.arch.msvc }} | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
components: clippy | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Run clippy | |
run: cargo clippy -- -D warnings | |
- name: Run tests | |
run: cargo test |