Skip to content

Commit

Permalink
Merge pull request #52 from n0-computer/update-ci
Browse files Browse the repository at this point in the history
ci: add more up to date n0 ci workflow
  • Loading branch information
rklaehn authored Aug 15, 2023
2 parents 8f1e7da + cf2045c commit 0ccd8f5
Show file tree
Hide file tree
Showing 4 changed files with 407 additions and 325 deletions.
112 changes: 112 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: tests

on:
push:
branches:
# This helps fill the caches properly, caches are not shared between PRs.
- main
pull_request:
branches:
- main

env:
MSRV: "1.63"
RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
- uses: swatinem/rust-cache@v2
- name: cargo fmt
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy --locked --workspace --all-targets --all-features

test:
runs-on: ${{ matrix.target.os }}
strategy:
fail-fast: false
matrix:
target:
- os: "ubuntu-latest"
toolchain: "x86_64-unknown-linux-gnu"
name: "Linux GNU"
- os: "macOS-latest"
toolchain: "x86_64-apple-darwin"
name: "macOS"
- os: "windows-latest"
toolchain: "x86_64-pc-windows-msvc"
name: "Windows MSVC"
- os: "windows-latest"
toolchain: "x86_64-pc-windows-gnu"
name: "Windows GNU"
channel:
- "stable"
- "beta"
- "nightly"
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.channel }}
targets: ${{ matrix.target.toolchain }}
- uses: swatinem/rust-cache@v2
- name: cargo test
run: cargo test --locked --workspace --all-features --bins --tests --examples

test-release:
runs-on: ${{ matrix.target.os }}
strategy:
fail-fast: false
matrix:
target:
- os: "ubuntu-latest"
toolchain: "x86_64-unknown-linux-gnu"
name: "Linux GNU"
- os: "macOS-latest"
toolchain: "x86_64-apple-darwin"
name: "macOS"
- os: "windows-latest"
toolchain: "x86_64-pc-windows-msvc"
name: "Windows MSVC"
- os: "windows-latest"
toolchain: "x86_64-pc-windows-gnu"
name: "Windows GNU"
channel:
- "stable"
- "beta"
- "nightly"
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.channel }}
targets: ${{ matrix.target.toolchain }}
- uses: swatinem/rust-cache@v2
- name: cargo test
run: cargo test --release --locked --workspace --all-features --bins --tests --examples

# Checks correct runtime deps and features are requested by not including dev-dependencies.
check-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
- uses: swatinem/rust-cache@v2
- name: cargo check
run: cargo check --workspace --all-features --lib --bins

minimal-crates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@nightly
- uses: swatinem/rust-cache@v2
- name: cargo check
run: |
rm -f Cargo.lock
cargo +nightly check -Z minimal-versions --workspace --all-features --lib --bins
68 changes: 0 additions & 68 deletions .github/workflows/rust.yml

This file was deleted.

Loading

0 comments on commit 0ccd8f5

Please sign in to comment.