-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
135 additions
and
0 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,34 @@ | ||
# This runs `cargo audit` on all dependencies (only if Cargo deps changed) | ||
|
||
name: Audit | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**/Cargo.toml' | ||
- '**/Cargo.lock' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
audit: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
~/.cargo | ||
target | ||
key: audit | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install dependencies | ||
run: cargo install cargo-audit --locked | ||
- name: Audit | ||
run: cargo audit | ||
|
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,58 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
RUST_BACKTRACE: "full" | ||
|
||
jobs: | ||
ci: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo | ||
target | ||
key: ${{ matrix.os }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
sudo apt update | ||
shell: bash | ||
|
||
- name: Test | ||
run: cargo test --release | ||
|
||
- name: Build | ||
run: | | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
cargo build --release --target x86_64-unknown-linux-gnu | ||
mv target/x86_64-unknown-linux-gnu/release/api-formatter . | ||
cargo build --release --target x86_64-unknown-linux-gnu --features=bundle | ||
fi | ||
shell: bash | ||
|
||
- name: Archive (Linux) | ||
if: ${{ runner.os == 'Linux' }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: linux | ||
path: linux.tar |
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,43 @@ | ||
name: Rust | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
fmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Format | ||
run: cargo fmt --all --check | ||
|
||
# Run typo checker separately. | ||
# This will fast-cancel other CI early if this fails. | ||
typo: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Spell Check | ||
uses: crate-ci/typos@master | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Clippy (fail on warnings) | ||
run: cargo clippy --workspace --all-features --all-targets -- -D warnings | ||
- name: Check compilation | ||
run: cargo check --all-features --verbose | ||
- name: Tests | ||
run: cargo test --all-features | ||
- name: Documentation | ||
run: cargo doc --workspace --all-features --no-deps |