CI #1136
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
# SPDX-FileCopyrightText: 2022 Lutris, Inc | |
# SPDX-License-Identifier: BlueOak-1.0.0 OR BSD-2-Clause-Patent | |
# SPDX-FileContributor: Piper McCorkle <[email protected]> | |
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
- cron: "0 0 * * *" | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
profile: minimal | |
override: true | |
- uses: Swatinem/rust-cache@v2 | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --all | |
fmt: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
components: rustfmt, clippy | |
profile: minimal | |
override: true | |
- uses: Swatinem/rust-cache@v2 | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --all | |
name: Clippy | |
# security_audit: | |
# name: Security Audit | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: actions-rs/audit-check@v1 | |
# with: | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
reuse: | |
name: REUSE | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
- run: pip install reuse | |
- run: reuse lint | |
validate_citation: | |
name: Validate CITATION.cff | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: LutrisEng/[email protected] | |
docs: | |
name: Build Docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
profile: minimal | |
override: true | |
- uses: Swatinem/rust-cache@v2 | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: doc | |
args: --all | |
- run: cp -R website/* target/doc/ | |
- uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref == 'refs/heads/main' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./target/doc | |
force_orphan: true | |
user_name: "github-actions[bot]" | |
user_email: "github-actions[bot]@users.noreply.github.com" | |
commit_message: Auto-generated documentation | |
coverage: | |
name: Test with coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
profile: minimal | |
override: true | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: coverage | |
- run: cargo test --verbose -p datom -- --nocapture | |
env: | |
CARGO_INCREMENTAL: "0" | |
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" | |
RUSTDOCFLAGS: "-Cpanic=abort" | |
- id: coverage | |
uses: actions-rs/[email protected] | |
- uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ${{ steps.coverage.outputs.report }} | |
test: | |
name: Test on ${{ matrix.os }} with Rust ${{ matrix.rust }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
rust: | |
# Ensure nightly doesn't break anything | |
- nightly | |
# Ensure nothing breaks in the next Rust release | |
- beta | |
# Ensure nothing breaks in the current Rust release | |
- stable | |
# Ensure the MSRV doesn't break | |
- "1.65" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
profile: minimal | |
override: true | |
- run: rustup target add aarch64-unknown-linux-gnu | |
- run: rustup target add x86_64-unknown-linux-gnu | |
- run: rustup target add aarch64-apple-darwin | |
- run: rustup target add x86_64-apple-darwin | |
- run: rustup target add x86_64-pc-windows-gnu | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
cache: "npm" | |
cache-dependency-path: "datom-node/package-lock.json" | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: "adopt" | |
java-version: "17" | |
cache: "gradle" | |
- uses: goto-bus-stop/setup-zig@v2 | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo install cargo-zigbuild | |
- run: cargo test --all --verbose -- --nocapture |