-
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
Showing
3 changed files
with
72 additions
and
49 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,62 @@ | ||
name: Build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
rust_version: | ||
type: string | ||
description: Rust version to use in the build | ||
required: false | ||
default: stable | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ inputs.rust_version }} | ||
components: rustfmt, clippy | ||
- name: Install cargo-deny | ||
uses: baptiste0928/cargo-install@v2 | ||
with: | ||
crate: cargo-deny | ||
version: "^0.14" | ||
|
||
- name: Cache cargo build | ||
uses: actions/cache@v3 | ||
with: | ||
path: target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: ${{ runner.os }}-cargo | ||
|
||
- name: Format | ||
run: cargo fmt --all -- --check | ||
- name: Clippy | ||
run: cargo clippy --workspace --all-features --all-targets -- -D warnings | ||
- name: Clippy (no features) | ||
run: cargo clippy -p term-transcript --no-default-features --lib | ||
- name: Clippy (features = svg) | ||
run: cargo clippy -p term-transcript --no-default-features --features svg --lib -- -D warnings | ||
- name: Clippy (features = test) | ||
run: cargo clippy -p term-transcript --no-default-features --features test --lib -- -D warnings | ||
|
||
- name: Check dependencies | ||
run: cargo deny --workspace --all-features check | ||
|
||
- name: Run tests | ||
run: cargo test --workspace --all-features --all-targets | ||
- name: Run doc tests | ||
run: cargo test --workspace --all-features --doc | ||
|
||
- name: Generate snapshots | ||
run: ./examples/generate-snapshots.sh | ||
- name: Test CLI tracing | ||
run: | | ||
RUST_LOG=term_transcript=debug \ | ||
cargo run -p term-transcript-cli --all-features -- \ | ||
exec 'echo Hello' |& grep INFO |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: Scheduled checks | ||
|
||
on: | ||
schedule: | ||
- cron: "0 2 * * MON" | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-reusable.yml |