-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
17391c3
commit 82d1d74
Showing
2 changed files
with
45 additions
and
30 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 |
---|---|---|
@@ -1,47 +1,44 @@ | ||
name: CI | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
branches: | ||
- main | ||
tags-ignore: | ||
- v* | ||
|
||
pull_request: | ||
branches: [main] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v3 | ||
|
||
# Nightly needed for `cargo +nightly fmt` below | ||
- name: Install Rust toolchain | ||
run: | | ||
rustup update | ||
rustup toolchain install nightly | ||
rustup toolchain install nightly --profile minimal | ||
rustup component add rustfmt --toolchain nightly | ||
rustup component add clippy --toolchain nightly | ||
# rustup component add clippy --toolchain nightly | ||
- name: Set up cargo cache | ||
uses: actions/cache@v3 | ||
continue-on-error: false | ||
- name: Install just | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: ${{ runner.os }}-cargo- | ||
|
||
- name: Check code format (cargo fmt) | ||
run: cargo +nightly fmt --check | ||
|
||
- name: Lint (cargo clippy) | ||
run: cargo clippy --no-deps -- -D warnings | ||
|
||
- name: Test (cargo test) | ||
env: | ||
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }} | ||
run: | | ||
printenv GCP_SERVICE_ACCOUNT > pub-sub-client-tests/secrets/active-road-365118-2eca6b7b8fd9.json | ||
cargo test | ||
tool: just | ||
|
||
- name: Set up Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Check code format | ||
run: just fmt_check | ||
|
||
- name: Run linter | ||
run: just lint | ||
|
||
- name: Run tests | ||
run: just test |
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,18 @@ | ||
set shell := ["bash", "-uc"] | ||
|
||
check: | ||
cargo check --tests | ||
|
||
fmt: | ||
cargo +nightly fmt | ||
|
||
fmt_check: | ||
cargo +nightly fmt --check | ||
|
||
lint: | ||
cargo clippy --no-deps -- -D warnings | ||
|
||
test: | ||
cargo test | ||
|
||
all: fmt check lint test |