Skip to content

Commit

Permalink
Schedule weekly builds
Browse files Browse the repository at this point in the history
  • Loading branch information
slowli committed Sep 17, 2023
1 parent bec0c87 commit d0b7dba
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 49 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build-reusable.yml
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
50 changes: 1 addition & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,55 +46,7 @@ jobs:
run: cargo test -p term-transcript ${{ matrix.features }} --doc

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
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
uses: ./.github/workflows/build-reusable.yml

build-docker:
needs:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/scheduled.yml
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

0 comments on commit d0b7dba

Please sign in to comment.