Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jgcrosta committed Mar 26, 2024
1 parent c17b583 commit 44dda78
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 112 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/general-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ jobs:
run: rustup component add rustfmt --toolchain nightly

- name: Check Formatting in Detectors
run: |
cd detectors && cargo +nightly fmt -- --check -v
working-directory: detectors
run: cargo +nightly fmt -- --check -v

- name: Check Formatting in Test Cases
run: |
find test-cases -name Cargo.toml -execdir cargo +nightly fmt -- --check -v \;
run: find test-cases -name Cargo.toml -execdir cargo +nightly fmt -- --check -v \;

clippy:
name: Lint with Clippy
Expand Down Expand Up @@ -72,12 +71,11 @@ jobs:
run: cargo install dylint-link

- name: Lint Code in Detectors
run: |
cd detectors && cargo clippy --all-targets --all-features -- -D warnings
working-directory: detectors
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Lint Code in Test Cases
run: |
find test-cases -name Cargo.toml -execdir cargo clippy --all-targets --all-features -- -D warnings \;
run: find test-cases -name Cargo.toml -execdir cargo clippy --all-targets --all-features -- -D warnings \;

udeps:
name: Check Unused Dependencies with cargo-udeps
Expand Down Expand Up @@ -110,10 +108,8 @@ jobs:
run: cargo install dylint-link

- name: Check Unused Dependencies in Detectors
run: |
cd detectors
cargo +nightly udeps --all-targets
working-directory: detectors
run: cargo +nightly udeps --all-targets

- name: Check Unused Dependencies in Test Cases
run: |
find test-cases -name Cargo.toml -execdir cargo +nightly udeps --all-targets \;
run: find test-cases -name Cargo.toml -execdir cargo +nightly udeps --all-targets \;
95 changes: 0 additions & 95 deletions .github/workflows/test-detector-soroban-version.yml

This file was deleted.

36 changes: 32 additions & 4 deletions .github/workflows/test-detectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
run: |
echo "matrix=$(find test-cases -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
integration-tests:
unit-tests:
name: Integration Tests
needs: [build, prepare-test-matrix]
strategy:
Expand All @@ -89,6 +89,34 @@ jobs:
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Run integration test for a specific test case
run: |
cd ${{ matrix.test-case }}
cargo test
working-directory: test-cases/${{ matrix.test-case }}
run: cargo test

integration-tests:
name: Integration Tests
needs: [build, prepare-test-matrix]
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
test-case: ${{fromJson(needs.prepare-test-matrix.outputs.matrix)}}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache cargo-scout dependencies
id: cache-cargo-scout-dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo
target
key: ${{ runner.os }}-cargo-scout-dependencies-${{ github.run_id }}
fail-on-cache-miss: true

- name: Run integration test for a specific test case
working-directory: test-cases/${{ matrix.test-case }}
run: cargo test --features integration-tests

0 comments on commit 44dda78

Please sign in to comment.