name: Build and Test on: push: branches: [ main ] pull_request: branches: [ main ] 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] 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 postgres dependencies run: | sudo apt update sudo apt install build-essential libreadline-dev zlib1g-dev flex bison libxml2-dev libcurl4-openssl-dev - 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 build run: | cargo build --workspace --bins --examples --tests - name: Run cargo test run: | cargo test -- --nocapture --test-threads=1