Skip to content

Commit

Permalink
[CI] fix fmt job with nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed Jul 24, 2024
1 parent 4c7f261 commit 786ce1b
Showing 1 changed file with 11 additions and 32 deletions.
43 changes: 11 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
pull_request:
branches: [master]
branches: [ master ]
workflow_dispatch:
inputs:
verbose:
Expand All @@ -34,9 +34,9 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
rust: [stable]
binary: [release]
os: [ ubuntu-20.04 ]
rust: [ stable ]
binary: [ release ]
env:
RUST_BACKTRACE: full
RUSTV: ${{ matrix.rust }}
Expand Down Expand Up @@ -72,43 +72,22 @@ jobs:
name: encointer-collator-${{ github.sha }}
path: target/release/encointer-collator


# Run all checks and unit test. This always run on debug mode
check:
name: Rust check ${{ matrix.check }} (${{ matrix.rust-target }})
runs-on: ${{ matrix.os }}
fmt:
name: cargo fmt
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable]
rust-target: [x86_64-unknown-linux-gnu]
check: [fmt] # ignore clippy for now
rust: [ nightly ]
rust-target: [ x86_64-unknown-linux-gnu ]
env:
RUST_BACKTRACE: full
RUSTV: ${{ matrix.rust }}
TARGET: ${{ matrix.rust-target }}
steps:
- uses: actions/checkout@v3

- name: Install protoc
run: sudo apt-get install protobuf-compiler

# With rustup's nice new toml format, we just need to run rustup show to install the toolchain
# https://github.com/actions-rs/toolchain/issues/126#issuecomment-782989659
- name: Setup Rust toolchain
run: rustup show

- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.rust-target }}-${{ matrix.check }}

- name: Fmt
if: ${{ matrix.check == 'fmt' }}
run: cargo fmt --all -- --check

- name: Clippy
if: ${{ matrix.check == 'clippy' }}
run: cargo clippy -- -D warnings
run: cargo +nightly fmt --all

cargo-toml-fmt:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -172,7 +151,7 @@ jobs:
name: Draft Release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [create_artifacts, build_primary_binaries, check]
needs: [ create_artifacts, build_primary_binaries, check ]
outputs:
release_url: ${{ steps.create-release.outputs.html_url }}
asset_upload_url: ${{ steps.create-release.outputs.upload_url }}
Expand Down

0 comments on commit 786ce1b

Please sign in to comment.