Skip to content

Commit

Permalink
toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJepsen committed Jun 6, 2024
1 parent 6b2811f commit 8031393
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 9 deletions.
48 changes: 39 additions & 9 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,52 @@
# Rust template: https://github.com/actions/starter-workflows/blob/main/ci/rust.yml
# Resources: https://docs.github.com/en/actions
# Examples: https://github.com/actions/starter-workflows
# Process: make small changes, push them, check the Actions tab on github
# also see templates https://github.com/rust-github/template/tree/main/.github/workflows
name: Rust

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always
CARGO_TERM_COLOR: always # pretty colors

jobs:
build:

lint:
name: lint project
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- nightly
steps:
- uses: actions/checkout@v4
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: rustup component add clippy
- run: cargo clippy -- -Dwarnings
test:
name: test project
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- nightly
steps:
- uses: actions/checkout@v4
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo test --all-features --verbose

fmt:
name: fmt project
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- nightly
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- uses: actions/checkout@v4
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check
15 changes: 15 additions & 0 deletions rust-toolchian.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# rustup toolchain config. We typically use nightly to enable better formatting and async support.
# https://rust-lang.github.io/rustup/overrides.html

[toolchain]
# what toolchain to use.
channel="nightly"

# option to specify a date to pin to a particular release
# date = "2024-03-19"

# profiles are groups of components to download when installing a toolchain.
# https://rust-lang.github.io/rustup/concepts/profiles.html
# "minimal" includes only the compiler, package manager, and standard lib.
# "default" further includes the formatter, linter, and documentation generator.
profile="default"

0 comments on commit 8031393

Please sign in to comment.