From 74b0a985990a479cc76ad45533a5705bca3da3d2 Mon Sep 17 00:00:00 2001 From: oluceps Date: Fri, 22 Nov 2024 06:44:17 +0800 Subject: [PATCH] ~ refactor ci --- .github/workflows/clippy.yaml | 22 --------- .github/workflows/fuzz.yaml | 17 ------- .github/workflows/{statix.yaml => lint.yaml} | 17 ++++++- .github/workflows/miri.yaml | 20 -------- .github/workflows/test.yaml | 49 ++++++++++++++++++++ .github/workflows/vm-test.yaml | 26 ----------- README.md | 2 +- 7 files changed, 65 insertions(+), 88 deletions(-) delete mode 100644 .github/workflows/clippy.yaml delete mode 100644 .github/workflows/fuzz.yaml rename .github/workflows/{statix.yaml => lint.yaml} (57%) delete mode 100644 .github/workflows/miri.yaml create mode 100644 .github/workflows/test.yaml delete mode 100644 .github/workflows/vm-test.yaml diff --git a/.github/workflows/clippy.yaml b/.github/workflows/clippy.yaml deleted file mode 100644 index eee76a9..0000000 --- a/.github/workflows/clippy.yaml +++ /dev/null @@ -1,22 +0,0 @@ -on: - push: - paths-ignore: - - 'docs/**' - - '**/*.md' -name: Clippy - -# Make sure CI fails on all warnings, including Clippy lints -env: - RUSTFLAGS: "-Dwarnings" - -jobs: - clippy: - name: check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Check - run: | - rustup default nightly - rustup component add clippy - cargo clippy --all-targets --all-features diff --git a/.github/workflows/fuzz.yaml b/.github/workflows/fuzz.yaml deleted file mode 100644 index 107939c..0000000 --- a/.github/workflows/fuzz.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: Fuzzy -on: - pull_request: - branches: ["*"] - paths-ignore: - - 'docs/**' - - '**/*.md' -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Test - run: | - rustup default nightly - cargo install cargo-fuzz - cargo fuzz run --all-features fuzz_parser_1 -- -max_len=256 -runs=16777216 diff --git a/.github/workflows/statix.yaml b/.github/workflows/lint.yaml similarity index 57% rename from .github/workflows/statix.yaml rename to .github/workflows/lint.yaml index 0def227..ad7bfe1 100644 --- a/.github/workflows/statix.yaml +++ b/.github/workflows/lint.yaml @@ -1,3 +1,4 @@ +name: Lint on: pull_request: branches: ["*"] @@ -10,11 +11,23 @@ on: - 'docs/**' - '**/*.md' -name: Nix code +# Make sure CI fails on all warnings, including Clippy lints +env: + RUSTFLAGS: "-Dwarnings" jobs: + clippy: + name: Clippy Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check + run: | + rustup default nightly + rustup component add clippy + cargo clippy --all-targets --all-features statix: - name: lint + name: Statix Check runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/miri.yaml b/.github/workflows/miri.yaml deleted file mode 100644 index c521519..0000000 --- a/.github/workflows/miri.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: Miri -on: - pull_request: - branches: ["*"] - paths-ignore: - - 'docs/**' - - '**/*.md' -jobs: - miri: - name: Miri - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Miri - run: | - rustup toolchain install nightly --component miri - rustup override set nightly - cargo miri setup - - name: Test with Miri - run: cargo miri test diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..e82de21 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,49 @@ +name: Test +on: + pull_request: + branches: ["*"] + paths-ignore: + - 'docs/**' + - '**/*.md' + push: + branches: ["main", "dev"] + paths-ignore: + - 'docs/**' + - '**/*.md' + +jobs: + miri: + name: UB detection + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Miri + run: | + rustup toolchain install nightly --component miri + rustup override set nightly + cargo miri setup + - name: Test with Miri + run: cargo miri test + fuzzy: + name: Fuzzy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Test + run: | + rustup default nightly + cargo install cargo-fuzz + cargo fuzz run --all-features fuzz_parser_1 -- -max_len=256 -runs=16777216 + vm: + name: VM Deploy + runs-on: ubuntu-latest + permissions: + id-token: "write" + contents: "read" + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - name: Run os for test + run: nix run github:nix-community/nixos-anywhere -- --flake .#tester --vm-test + diff --git a/.github/workflows/vm-test.yaml b/.github/workflows/vm-test.yaml deleted file mode 100644 index 1fc769b..0000000 --- a/.github/workflows/vm-test.yaml +++ /dev/null @@ -1,26 +0,0 @@ -on: - pull_request: - branches: ["*"] - paths-ignore: - - 'docs/**' - - '**/*.md' - push: - branches: ["main", "dev"] - paths-ignore: - - 'docs/**' - - '**/*.md' - -name: VM - -jobs: - test: - runs-on: ubuntu-latest - permissions: - id-token: "write" - contents: "read" - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - - name: Run os for test - run: nix run github:nix-community/nixos-anywhere -- --flake .#tester --vm-test diff --git a/README.md b/README.md index 210a943..d30b650 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![nixos infra](https://img.shields.io/badge/NixOS%20infra-3A8FB7?style=for-the-badge&logo=nixos&logoColor=BBDDE5)](https://nixos.wiki/wiki/Comparison_of_secret_managing_schemes) [![doc](https://img.shields.io/badge/document-B4A582?style=for-the-badge&logo=gitbook&logoColor=white)](https://oluceps.github.io/vaultix/) [![eval status](https://img.shields.io/github/actions/workflow/status/oluceps/vaultix/eval.yaml?branch=main&style=for-the-badge&label=eval&color=00AA90)](https://github.com/oluceps/vaultix/actions?query=branch%3Amain) -[![test status](https://img.shields.io/github/actions/workflow/status/oluceps/vaultix/vm-test.yaml?branch=main&style=for-the-badge&label=test&color=00AA90)](https://github.com/oluceps/vaultix/actions?query=branch%3Amain) +[![test status](https://img.shields.io/github/actions/workflow/status/oluceps/vaultix/test.yaml?branch=main&style=for-the-badge&label=test&color=00AA90)](https://github.com/oluceps/vaultix/actions?query=branch%3Amain) Secret managing scheme for NixOS