-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLI: add CI for lint, security, reformat with nightly
- Loading branch information
1 parent
9c0b41e
commit 3fa47ef
Showing
24 changed files
with
205 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: CLI Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'svix-cli/**' | ||
- '.github/workflows/cli-lint.yml' | ||
pull_request: | ||
paths: | ||
- 'svix-cli/**' | ||
- '.github/workflows/cli-lint.yml' | ||
- 'openapi.json' | ||
|
||
# When pushing to a PR, cancel any jobs still running for the previous head commit of the PR | ||
concurrency: | ||
# head_ref is only defined for pull requests, run_id is always unique and defined so if this | ||
# workflow was not triggered by a pull request, nothing gets cancelled. | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
check-fmt: | ||
name: Check formatting | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rustfmt | ||
|
||
- name: rustfmt | ||
run: cargo fmt -- --check | ||
working-directory: svix-cli | ||
|
||
test-versions: | ||
name: CLI Lint | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
matrix: | ||
rust: [stable, beta] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Regen openapi libs | ||
run: | | ||
yarn | ||
./regen_openapi.sh | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
components: clippy | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
workspaces: "svix-cli -> target" | ||
# only save the cache on the main branch | ||
# cf https://github.com/Swatinem/rust-cache/issues/95 | ||
save-if: ${{ github.ref == 'refs/heads/main' }} | ||
# include relevant information in the cache name | ||
prefix-key: "cli-${{ matrix.rust }}" | ||
|
||
- uses: taiki-e/install-action@nextest | ||
|
||
- name: Clippy | ||
run: cargo clippy --all-targets --all-features -- -D warnings | ||
working-directory: svix-cli | ||
|
||
- name: Run tests | ||
run: cargo nextest run | ||
working-directory: svix-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: CLI Security | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'svix-cli/**/Cargo.toml' | ||
- 'svix-cli/**/Cargo.lock' | ||
- '.github/workflows/cli-security.yml' | ||
pull_request: | ||
paths: | ||
- 'rust/**/Cargo.toml' | ||
- 'rust/**/Cargo.lock' | ||
- '.github/workflows/cli-security.yml' | ||
|
||
jobs: | ||
security_audit: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: EmbarkStudios/cargo-deny-action@v2 | ||
with: | ||
manifest-path: svix-cli/Cargo.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
imports_granularity = "Crate" | ||
group_imports = "StdExternalCrate" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.