Sort Step enum and keep it sorted in the ci.yml workflow (#1104)
* Add `step-enum-sorted` to `ci.yml` workflow * Sort `Step` enum * Sort `Step` enum
This commit is contained in:
21
.github/workflows/ci.yml
vendored
21
.github/workflows/ci.yml
vendored
@@ -24,8 +24,25 @@ jobs:
|
||||
run: |
|
||||
cargo fmt --all -- --check
|
||||
|
||||
step-enum-sorted:
|
||||
name: Step enum sorted
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check if `Step` enum is sorted
|
||||
run: |
|
||||
ENUM_NAME="Step"
|
||||
FILE="src/config.rs"
|
||||
awk "/enum $ENUM_NAME/,/}/" "$FILE" | \
|
||||
grep -E '^\s*[A-Za-z_][A-Za-z0-9_]*\s*,?$' | \
|
||||
sed 's/[, ]//g' > original.txt
|
||||
sort original.txt > sorted.txt
|
||||
diff original.txt sorted.txt
|
||||
|
||||
main:
|
||||
needs: fmt
|
||||
needs: [fmt, step-enum-sorted]
|
||||
name: ${{ matrix.target_name }} (check, clippy)
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
@@ -84,4 +101,4 @@ jobs:
|
||||
- name: Run cargo test
|
||||
# ONLY run test with cargo
|
||||
if: matrix.use_cross == false
|
||||
run: cargo test --locked --target ${{ matrix.target }}
|
||||
run: cargo test --locked --target ${{ matrix.target }}
|
||||
|
||||
@@ -53,9 +53,9 @@ pub type Commands = BTreeMap<String, String>;
|
||||
pub enum Step {
|
||||
AM,
|
||||
AppMan,
|
||||
Aqua,
|
||||
Asdf,
|
||||
Atom,
|
||||
Aqua,
|
||||
Audit,
|
||||
AutoCpufreq,
|
||||
Bin,
|
||||
@@ -90,12 +90,13 @@ pub enum Step {
|
||||
Gcloud,
|
||||
Gem,
|
||||
Ghcup,
|
||||
GithubCliExtensions,
|
||||
GitRepos,
|
||||
GithubCliExtensions,
|
||||
GnomeShellExtensions,
|
||||
Go,
|
||||
Guix,
|
||||
Haxelib,
|
||||
Helix,
|
||||
Helm,
|
||||
HomeManager,
|
||||
JetBrainsToolbox,
|
||||
@@ -103,17 +104,16 @@ pub enum Step {
|
||||
Julia,
|
||||
Juliaup,
|
||||
Kakoune,
|
||||
Helix,
|
||||
Krew,
|
||||
Lure,
|
||||
Lensfun,
|
||||
Lure,
|
||||
Macports,
|
||||
Mamba,
|
||||
Miktex,
|
||||
Mas,
|
||||
Maza,
|
||||
Micro,
|
||||
MicrosoftStore,
|
||||
Miktex,
|
||||
Mise,
|
||||
Myrepos,
|
||||
Nix,
|
||||
|
||||
Reference in New Issue
Block a user