Skip to content

Commit

Permalink
Avoid duplicating build_and_test workflow (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-h-kastner-aws authored Nov 1, 2023
1 parent e598d7a commit 191ffbb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 49 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build and Test
on:
workflow_call:

jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
steps:
- uses: actions/checkout@v3
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: ./panic_safety.sh
- run: cargo fmt --all --check
- run: RUSTFLAGS="-D warnings -F unsafe-code" cargo build --verbose --features "experimental"
- run: RUSTFLAGS="-D warnings -F unsafe-code" cargo build --verbose
- run: cargo doc --all-features --no-deps
- run: cargo clippy --all-features
- run: cargo test --verbose --features "experimental"
- run: cargo test --verbose
- run: cargo test --verbose --no-default-features
- run: cargo test --verbose -- --ignored
- run: cargo bench --no-run
- run: cargo audit --deny warnings # For some reason this hangs if you don't cargo build first
26 changes: 1 addition & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,7 @@ env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
steps:
- uses: actions/checkout@v3
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo fmt --all --check
- run: RUSTFLAGS="-D warnings -F unsafe-code" cargo build --verbose --features "experimental"
- run: RUSTFLAGS="-D warnings -F unsafe-code" cargo build --verbose
- run: cargo test --verbose --features "experimental"
- run: cargo test --verbose
- run: cargo doc --all-features
- run: cargo clippy --all-features
- run: ./panic_safety.sh
- run: cargo test --verbose -- --ignored
- run: cargo bench --no-run
- run: cd cedar-policy ; cargo test --no-default-features --verbose
- run: cd cedar-policy-cli ; cargo test --no-default-features --verbose
- run: cd cedar-policy-core ; cargo test --no-default-features --verbose
- run: cd cedar-policy-formatter ; cargo test --no-default-features --verbose
- run: cd cedar-policy-validator ; cargo test --no-default-features --verbose
- run: cargo audit --deny warnings # For some reason this hangs if you don't cargo build first
uses: ./.github/workflows/build_and_test.yml

cargo_semver_checks:
name: Cargo SemVer Checks
Expand Down
25 changes: 1 addition & 24 deletions .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,4 @@ env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
steps:
- uses: actions/checkout@v3
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo fmt --all --check
- run: RUSTFLAGS="-D warnings -F unsafe-code" cargo build --verbose --features "experimental"
- run: RUSTFLAGS="-D warnings -F unsafe-code" cargo build --verbose
- run: cargo test --verbose --features "experimental"
- run: cargo test --verbose
- run: cargo doc --all-features
- run: cargo clippy
- run: ./panic_safety.sh
- run: cargo test --verbose -- --ignored
- run: cargo bench --no-run
- run: cd cedar-policy ; cargo test --no-default-features --verbose
- run: cd cedar-policy-cli ; cargo test --no-default-features --verbose
- run: cd cedar-policy-core ; cargo test --no-default-features --verbose
- run: cd cedar-policy-formatter ; cargo test --no-default-features --verbose
- run: cd cedar-policy-validator ; cargo test --no-default-features --verbose
uses: ./.github/workflows/build_and_test.yml

0 comments on commit 191ffbb

Please sign in to comment.