monster-rs 0.4.1

Monster is a symbolic execution engine for 64-bit RISC-U code
Documentation
name: Test

on:
  push:
  schedule:
    # trigger weekly at 12am
    # this build should run with caches disabled
    - 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 }}

      # this action needs write permnissions for the given 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
            # linter and format checkers are not executed for experimental platform
            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') }}
        # MinGw64 and Git is already installed
        # https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
        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
        # disable cache for scheduled builds
        # Unfortunately MacOs in combination with the Github Cache action has a bug:
        # https://github.com/actions/virtual-environments/issues/2619
        # This is a workaround to fix curroption of cached cargo dependencies
        if: ${{ github.event_name != 'schedule' && !contains(matrix.os, 'macos') }}
        with:
          # cargo cache files are stored in `~/.cargo` on Linux/macOS
          # source for paths: https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
          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
        # execute Clippy with Github integration for the target platform (Linux with fixed toolchain version)
        # this action needs write permnissions for the given Github token
        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
        # execute CLI-only version of Clippy for all platforms besides the target and the experimental platform
        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