name: Build and Test on: push jobs: regression-check: strategy: matrix: # If we want to duplicate this job for different # Rust toolchains (e.g. nightly or 1.37.0), add them here. rust_toolchain: [stable] os: [ubuntu-latest, macos-latest] timeout-minutes: 30 name: run regression test suite runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v2 with: submodules: true fetch-depth: 2 - name: install rust toolchain ${{ matrix.rust_toolchain }} uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.rust_toolchain }} override: true - name: Install Ubuntu postgres dependencies if: matrix.os == 'ubuntu-latest' run: | sudo apt update sudo apt install build-essential libreadline-dev zlib1g-dev flex bison libseccomp-dev - name: Install macOs postgres dependencies if: matrix.os == 'macos-latest' run: brew install flex bison - name: Set pg revision for caching id: pg_ver run: echo ::set-output name=pg_rev::$(git rev-parse HEAD:vendor/postgres) - name: Cache postgres build id: cache_pg uses: actions/cache@v2 with: path: | tmp_install/ key: ${{ runner.os }}-pg-${{ steps.pg_ver.outputs.pg_rev }} - name: Build postgres if: steps.cache_pg.outputs.cache-hit != 'true' run: make postgres - name: Cache cargo deps id: cache_cargo uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.lock') }} - name: Run cargo clippy run: ./run_clippy.sh - name: Run cargo test run: cargo test --all --all-targets