You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.8 KiB
YAML

name: Test (PR)
on: [pull_request]
env:
BUILD: false
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux-stable, macos-stable, windows-stable]
include:
- build: linux-stable
os: ubuntu-latest
rust: stable
- build: macos-stable
os: macos-latest
rust: stable
- build: windows-stable
os: windows-latest
rust: stable
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Setup environment
run: |
chmod +x ci/buildvars.sh
ci/buildvars.sh
- name: Cache Cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ matrix.build }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ matrix.build }}-cargo-registry-
if: env.BUILD == 'true'
- name: Cache Cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ matrix.build }}-cargo-index-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ matrix.build }}-cargo-index-
if: env.BUILD == 'true'
- name: Cache Cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ matrix.build }}-target-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ matrix.build }}-target-
if: env.BUILD == 'true'
- name: Install Rust
run: |
rustup update ${{ matrix.rust }} --no-self-update
rustup default ${{ matrix.rust }}
if: env.BUILD == 'true'
- name: Run Tests
run: make test
env:
RUST_BACKTRACE: 1