Skip to content

tests

tests #419

Workflow file for this run

name: tests
on:
schedule:
- cron: "0 0 * * 5"
pull_request:
push:
paths-ignore:
- "docs/**"
workflow_dispatch:
jobs:
check:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt
profile: minimal
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
build:
name: Test
runs-on: ${{ matrix.os }}
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 1
RUST_LOG: vki=trace
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
toolchain: [stable, nightly]
steps:
- uses: actions/checkout@v2
- name: Install rust
uses: actions-rs/toolchain@v1
id: rust
with:
toolchain: ${{ matrix.toolchain }}
override: true
profile: minimal
- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
with:
command: update
- name: Cache cargo
# TODO: Cached builds are failing on macOS when compiling the examples:
# error[E0463]: can't find crate for `serde_derive` which `gltf` depends on
# --> examples/gltf_viewer.rs:400:13
# Note that it only seems to affect cached builds -- azure pipelines builds
# are still working (and they don't use a build cache)
if: ${{ runner.os == 'disabled' }} # if: ${{ runner.os != 'macOS' }}
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ matrix.toolchain }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.toolchain }}-cargo-
- name: Install GLFW dependencies
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt update
sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev
- name: Build lib
uses: actions-rs/cargo@v1
with:
command: build
args: --lib
- name: Build tests and examples
uses: actions-rs/cargo@v1
with:
command: test
args: --no-run
- name: Run unit tests
uses: actions-rs/cargo@v1
with:
command: test
args: --lib --examples
- uses: aloucks/vulkan-ci@v1
- name: Run integration tests
uses: actions-rs/cargo@v1
with:
command: test
args: --tests
env:
zVK_LOADER_DEBUG: all