Skip to content

Commit

Permalink
chore: format ci yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
kayagokalp committed Feb 1, 2024
1 parent c941e6e commit 2c48f42
Showing 1 changed file with 19 additions and 33 deletions.
52 changes: 19 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
name: CI

on:
'on':
push:
branches:
- master
pull_request:
pull_request: null
release:
types: [published]

types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: '${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}'
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
cargo-build-workspace:
runs-on: ubuntu-latest
Expand All @@ -28,10 +25,9 @@ jobs:
name: Cargo Build Workspace
with:
command: build
args: --workspace --all-features --all-targets
args: '--workspace --all-features --all-targets'
env:
RUSTFLAGS: "-D warnings"

RUSTFLAGS: '-D warnings'
cargo-clippy:
runs-on: ubuntu-latest
steps:
Expand All @@ -44,8 +40,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features --all-targets -- -D warnings

args: '--all-features --all-targets -- -D warnings'
cargo-toml-fmt-check:
runs-on: ubuntu-latest
steps:
Expand All @@ -57,10 +52,9 @@ jobs:
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-toml-lint
version: "0.1"
version: '0.1'
- name: Run Cargo.toml linter
run: git ls-files | grep Cargo.toml$ | xargs --verbose -n 1 cargo-toml-lint

cargo-fmt-check:
runs-on: ubuntu-latest
steps:
Expand All @@ -72,7 +66,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
args: '--all -- --check'
cargo-test-workspace:
runs-on: ubuntu-latest
steps:
Expand All @@ -85,14 +79,12 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: test

cargo-unused-deps-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
with:
# `cargo-udeps` requires nightly to run
toolchain: nightly
default: true
- uses: Swatinem/rust-cache@v1
Expand All @@ -105,33 +97,27 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: udeps
args: --all-targets

args: '--all-targets'
publish:
# Only do this job if publishing a release
needs:
[
cargo-build-workspace,
cargo-clippy,
cargo-fmt-check,
cargo-test-workspace,
cargo-unused-deps-check,
]
- cargo-build-workspace
- cargo-clippy
- cargo-fmt-check
- cargo-test-workspace
- cargo-unused-deps-check
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install toolchain
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true

- name: Publish crate
uses: katyo/publish-crates@v1
with:
publish-delay: 30000
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
registry-token: '${{ secrets.CARGO_REGISTRY_TOKEN }}'

0 comments on commit 2c48f42

Please sign in to comment.