100 lines
2.4 KiB
YAML
100 lines
2.4 KiB
YAML
name: CI
|
|
|
|
on: [pull_request, push]
|
|
|
|
jobs:
|
|
# Check code formatting.
|
|
fmt:
|
|
name: Rustfmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v2
|
|
- name: Install rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
components: rustfmt
|
|
profile: minimal
|
|
override: true
|
|
- name: Run rustfmt
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: fmt
|
|
args: --all -- --check
|
|
|
|
# Static analyzer.
|
|
clippy:
|
|
name: Clippy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v2
|
|
- name: Install rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
profile: minimal
|
|
override: true
|
|
- name: Run clippy
|
|
uses: actions-rs/clippy-check@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
args: --all --tests --all-features -- -D warnings
|
|
|
|
# Security audit.
|
|
audit:
|
|
name: Security audit
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/audit-check@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# Tests.
|
|
test:
|
|
name: ${{ matrix.build }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- build: Linux
|
|
os: ubuntu-latest
|
|
- build: macOS
|
|
os: macOS-latest
|
|
- build: Windows
|
|
os: windows-latest
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v2
|
|
- name: Install rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
profile: minimal
|
|
override: true
|
|
- name: Install java
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: '1.8.0'
|
|
- name: Build
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --examples --all
|
|
- name: Test default features
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
- name: Shellcheck
|
|
if: runner.os == 'Linux'
|
|
run: .github/workflows/shellcheck.sh
|
|
- name: Test invocation
|
|
if: runner.os != 'Windows'
|
|
run: .github/workflows/run_invocation_tests.sh
|
|
- name: Test invocation
|
|
if: runner.os == 'Windows'
|
|
run: .github/workflows/run_windows_invocation_tests.ps1
|