From af0aa81ce7d683648dae2dae91df6f7cd52d1b1d Mon Sep 17 00:00:00 2001 From: Ivan Krivosheev Date: Wed, 20 Nov 2024 00:15:09 +0300 Subject: [PATCH] Upgrade CI pipelines (#79) --- .github/workflows/docker.yml | 5 ++--- .github/workflows/nightly.yml | 26 ++++++++------------------ .github/workflows/release.yml | 14 +++++++------- .github/workflows/stable.yml | 18 +++++++----------- Cargo.toml | 8 +++++++- 5 files changed, 31 insertions(+), 40 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 96131ee..8b36853 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -12,11 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 - + uses: actions/checkout@v4 - name: Docker meta id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: | devinr528/cargo-sort diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c08699e..e928d35 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -11,21 +11,11 @@ jobs: name: Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - profile: minimal - override: true - components: rustfmt, clippy - - name: Check formatting - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check - - name: Catch common mistakes - uses: actions-rs/cargo@v1 - with: - command: mean-clippy - - name: Sort Cargo.toml - run: cargo install cargo-sort && cargo sort -gc + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt, clippy + - name: Check formatting + run: cargo fmt -- --check + - name: Catch common mistakes + run: cargo clippy diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7845a3b..80ee72b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,10 +9,10 @@ jobs: create-release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: taiki-e/create-gh-release-action@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + token: ${{ secrets.GITHUB_TOKEN }} upload-assets: strategy: @@ -23,10 +23,10 @@ jobs: - windows-latest runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: taiki-e/upload-rust-binary-action@v1 with: bin: cargo-sort - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CARGO_PROFILE_RELEASE_LTO: true + tar: unix + zip: windows + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index aea9d7c..dede84e 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -11,16 +11,12 @@ jobs: name: Check strategy: matrix: - os: [ ubuntu-latest, windows-latest ] + os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - name: Run tests - uses: actions-rs/cargo@v1 - with: - command: test + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - name: Run tests + run: cargo test diff --git a/Cargo.toml b/Cargo.toml index 7904776..8d85a29 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "cargo-sort" version = "1.1.0" -authors = ["Devin R ", "Andronik Ordian "] +authors = [ + "Devin R ", + "Andronik Ordian ", +] license = "MIT/Apache-2.0" description = "Check if tables and items in a .toml file are lexically sorted" repository = "https://github.com/DevinR528/cargo-sort" @@ -43,3 +46,6 @@ similar-asserts = "1.5.0" # name = "fuzz" # path = "src/fuzz.rs" # required-features = ["fuzz"] + +[profile.release] +lto = true