Skip to content

Commit

Permalink
[CI] make fmt job like fellows/runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed Jul 24, 2024
1 parent a1bf88d commit fc7b5a5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 18 deletions.
19 changes: 1 addition & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,6 @@ jobs:
name: encointer-collator-${{ github.sha }}
path: target/release/encointer-collator

fmt:
name: cargo fmt
runs-on: ubuntu-latest
strategy:
matrix:
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: Fmt
run: cargo +nightly fmt --all

cargo-toml-fmt:
runs-on: ubuntu-latest
container: "tamasfe/taplo:0.7.0-alpine"
Expand Down Expand Up @@ -151,7 +134,7 @@ jobs:
name: Draft Release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [ create_artifacts, build_primary_binaries, fmt ]
needs: [ create_artifacts, build_primary_binaries ]
outputs:
release_url: ${{ steps.create-release.outputs.html_url }}
asset_upload_url: ${{ steps.create-release.outputs.upload_url }}
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Rustfmt (check)"

on:
push:
branches:
- master
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-dev*'
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
verbose:
description: "Set --verbose to get verbose build output"
required: false
default: 'true'

jobs:
rustfmt:
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set rust version via common env file
run: cat .github/env >> $GITHUB_ENV

- name: Install nightly toolchain
run: rustup toolchain install "nightly-$RUST_NIGHTLY_VERSION" --profile minimal --component rustfmt

- name: Rustfmt (check)
run: cargo +nightly-$RUST_NIGHTLY_VERSION fmt --all -- --check

0 comments on commit fc7b5a5

Please sign in to comment.