Skip to content

Commit

Permalink
wip: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes committed Jan 17, 2023
1 parent 9e5bcf6 commit 881a551
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 30 deletions.
45 changes: 16 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,38 @@ on:
pull_request:
branches: [ main ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Read toolchain file
id: rust-toolchain
run: |
RUST_TOOLCHAIN=$(grep 'channel' rust-toolchain.toml | awk '{split($0,a," = "); print a[2]}' | tr -d '"')
echo "RUST_TOOLCHAIN=$RUST_TOOLCHAIN" >> $GITHUB_OUTPUT
shell: bash

- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ steps.rust-toolchain.outputs.RUST_TOOLCHAIN }}

- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-targets --all-features --verbose
run: cargo build --all-targets --all-features --verbose

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose
run: cargo test --verbose

- name: Validate config
uses: actions-rs/cargo@v1
with:
command: run
args: config example.config.toml
run: cargo run config example.config.toml

lint:
runs-on: ubuntu-latest
Expand All @@ -51,25 +46,17 @@ jobs:
uses: actions/checkout@v3

- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
profile: minimal
components: rustfmt, clippy
override: true

- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Check format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --check
run: cargo +nightly fmt --all --check

- uses: actions-rs/clippy-check@v1
with:
args: --all-targets --all-features --verbose -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check clippy
run: cargo +nightly clippy --all-targets --all-features --verbose -- -D warnings
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test:
fmt:
cargo +nightly fmt --all
lint: fmt validate-example-config
cargo clippy --all-targets --all-features
cargo +nightly clippy --all-targets --all-features
build:
cargo build --all-targets --all-features
run-ci: lint build test

0 comments on commit 881a551

Please sign in to comment.