name: Test
on:
push:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
security_scan:
name: Security Scan of Dependencies
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Check Github Permissions
id: check-permissions
uses: scherermichael-oss/action-has-permission@master
with:
required-permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rs/audit-check@v1
if: ${{ steps.check-permissions.outputs.has-permission }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
build-and-test:
name: Build and Test on ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
toolchain: [1.52.0]
os: [ubuntu-20.04, macos-10.15, windows-2019]
experimental: [false]
include:
- platform: Linux
os: ubuntu-20.04
features: z3,boolector
- platform: MacOs
os: macos-10.15
features: z3,boolector
- platform: Windows
os: windows-2019
features: z3
- platform: latest Rust
toolchain: stable
os: ubuntu-latest
experimental: true
features: z3,boolector
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
override: true
- name: Setup Windows Environment
if: ${{ contains(matrix.os, 'windows') }}
run: |
choco install make -y
echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
echo "TMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
- name: Check Github Permissions
id: check-permissions
uses: scherermichael-oss/action-has-permission@master
with:
required-permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Cargo Dependencies
uses: actions/cache@v2
env:
cache-name: cache-cargo-dependencies
if: ${{ github.event_name != 'schedule' && !contains(matrix.os, 'macos') }}
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target
key: ${{ runner.os }}-${{ github.job }}-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
- name: Check Format
uses: actions-rs/cargo@v1
if: ${{ !matrix.experimental }}
with:
command: fmt
args: -- --check
- name: Clippy
uses: actions-rs/clippy-check@v1
if: ${{ !matrix.experimental && contains(matrix.os, 'ubuntu') && steps.check-permissions.outputs.has-permission }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --features ${{ matrix.features }} -- -D warnings
name: Clippy
- name: Clippy CLI
uses: actions-rs/cargo@v1
if: ${{ !matrix.experimental && (!contains(matrix.os, 'ubuntu') || !steps.check-permissions.outputs.has-permission) }}
with:
command: clippy
args: --all-targets --features ${{ matrix.features }} -- -D warnings
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --features ${{ matrix.features }} --locked
- name: Build Benchmarks
uses: actions-rs/cargo@v1
with:
command: bench
args: --benches --no-run --features ${{ matrix.features }} --locked
- name: Doc
uses: actions-rs/cargo@v1
with:
command: doc
args: --features ${{ matrix.features }} --locked
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --features ${{ matrix.features }} --locked