Test #196
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Test | |
on: | |
# Allow running this workflow manually from the Actions tab | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- development | |
# Run weekly on the default branch to make sure it always builds with the latest rust release | |
schedule: | |
- cron: '30 5 * * 1' | |
jobs: | |
lint: | |
# It is possible for lints to break after merge (e.g., new clippy checks), but it's not worth | |
# breaking the build if that happens. So we'll skip this job for scheduled runs. | |
if: github.event_name != 'schedule' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v3 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Format check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: -- --check | |
- name: Lint | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --all-features -- -D warnings | |
test-matrix: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@master | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
- name: Test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
# This job reports the results of the test matrix above | |
test: | |
if: always() | |
needs: test-matrix | |
runs-on: ubuntu-latest | |
steps: | |
- if: needs.test-matrix.result != 'success' | |
name: Fail the build | |
run: exit 1 |