Skip to content

Commit

Permalink
Update CI and toolchain.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebschmi committed Sep 19, 2024
1 parent be91a1e commit 127ea7c
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 83 deletions.
159 changes: 77 additions & 82 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,101 2,96 @@ name: Tests and Lints

on: [push, pull_request]

env:
RUSTFLAGS: "-Dwarnings"

jobs:
build_test_format_lint:
name: ${{matrix.command.name}} (${{matrix.toolchain}})
rust_check:
name: Rust check
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
toolchain: [stable, 1.75.0]
command:
- name: Check
command: check
args: --all-features --all --all-targets
- name: Test
command: test
args: --all-features
include:
- toolchain: stable
command:
name: Format
command: fmt
args: -- --check
- toolchain: stable
command:
name: Lint
command: clippy
args: --all-features --tests --benches -- -D clippy::all -D warnings
- toolchain: stable
command:
name: Doc
command: doc
args: --all-features --all
fail-fast: true

steps:
- uses: actions/checkout@v3

- name: Install toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: cargo check
run: cargo check --bins --tests --all-features

rust_format:
name: Rust format
runs-on: ubuntu-latest

strategy:
fail-fast: true

steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/checkout@v3

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
default: true
components: rustfmt, clippy

- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-${{ matrix.command.name }}-${{ matrix.toolchain }}

- name: ${{matrix.command.name}}
uses: actions-rs/cargo@v1
with:
command: ${{matrix.command.command}}
args: ${{matrix.command.args}}

build_test_format_lint_optional:
name: ${{matrix.command.name}} (${{matrix.toolchain}}, optional)
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt

- name: cargo format
uses: actions-rust-lang/rustfmt@v1

rust_lint:
name: Rust lint
runs-on: ubuntu-latest
needs: ["rust_check", "rust_format"]

strategy:
fail-fast: false
fail-fast: true
matrix:
toolchain: [beta, nightly]
command:
- name: Check
command: check
args: --all-features --all --all-targets
- name: Test
command: test
args: --all-features
toolchain: [null, "stable", "beta", "nightly"]

steps:
- uses: actions/checkout@v3

- name: Install toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
toolchain: ${{matrix.toolchain}}

- name: cargo clippy
run: cargo clippy --bins --tests --all-features

rust_test:
name: Rust test
runs-on: ubuntu-latest
needs: ["rust_check", "rust_format"]

strategy:
fail-fast: true

steps:
- uses: actions/checkout@v3

- name: Install toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: cargo test
run: cargo test --all-features

rust_doc:
name: Rust doc
runs-on: ubuntu-latest
needs: ["rust_check", "rust_format"]

strategy:
fail-fast: true

steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/checkout@v3

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
default: true
components: rustfmt, clippy

- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-${{ matrix.command.name }}-${{ matrix.toolchain }}-optional

- name: ${{matrix.command.name}}
uses: actions-rs/cargo@v1
with:
command: ${{matrix.command.command}}
args: ${{matrix.command.args}}
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: cargo doc
run: cargo doc --all-features
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 10,7 @@ documentation = "https://docs.rs/matchtigs"
homepage = "https://github.com/algbio/matchtigs"
repository = "https://github.com/algbio/matchtigs"
edition = "2021"
rust-version = "1.75.0"
rust-version = "1.80.1"
license-file = "LICENSE.txt"

[lib]
Expand Down
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 1,2 @@
[toolchain]
channel = "1.80.1"

0 comments on commit 127ea7c

Please sign in to comment.