name: Continuous integration
on: [push, pull_request]
env:
CRATE_NAME: libpg_query-sys
RUST_BACKTRACE: 1
jobs:
test:
name: Test - ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- os_name: Linux
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os_name: macOS
os: macOS-latest
target: x86_64-apple-darwin
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install GNU tar on macOS
run: |
brew install gnu-tar
echo "PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
if: matrix.platform.os == 'macOS-latest'
- name: Install LLVM on Windows
run: |
choco install llvm
if: matrix.platform.os == 'windows-latest'
- name: Cache cargo target directories
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-and-target-${{ matrix.platform.os }}-${{ matrix.platform.target }}-${{ matrix.toolchain }}-${{ hashFiles('Cargo.lock') }}-v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: ${{ matrix.toolchain }}
override: true
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --target=${{ matrix.platform.target }}
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --target=${{ matrix.platform.target }}