Skip to content

Commit

Permalink
[eclipse-iceoryx#3] Use strategy in static-code-analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
elfenpiff committed Mar 26, 2024
1 parent a6102bc commit c49f822
Showing 1 changed file with 25 additions and 234 deletions.
259 changes: 25 additions & 234 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,13 @@ jobs:
- name: Check license header
run: ./internal/scripts/ci_test_spdx_license_header.sh

preflight-check-windows:
timeout-minutes: 10
runs-on: windows-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy

- name: Run cargo fmt
run: cargo fmt --all -- --check

- name: Run cargo clippy
run: cargo clippy -- -D warnings

preflight-check-linux:
static-code-analysis:
needs: preflight-check
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macOS-latest]
timeout-minutes: 10
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -58,8 +43,12 @@ jobs:
- name: Run cargo clippy
run: cargo clippy -- -D warnings

windows-stable:
needs: [preflight-check, preflight-check-windows]
windows:
needs: [preflight-check, static-code-analysis]
strategy:
matrix:
toolchain: [stable, 1.73.0, beta, nightly]
mode: ["--release", ""]
timeout-minutes: 10
runs-on: windows-latest
steps:
Expand All @@ -69,222 +58,24 @@ jobs:
- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy

- name: Prepare system
run: internal\scripts\ci_prepare_windows.bat

- name: Run cargo build
run: cargo build --workspace --all-targets
run: cargo build --workspace --all-targets ${{ matrix.mode }}

- name: Run cargo test
run: cargo test --workspace --no-fail-fast

windows-min-version:
needs: [preflight-check, preflight-check-windows]
timeout-minutes: 10
runs-on: windows-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: 1.73.0
components: rustfmt, clippy

- name: Prepare system
run: internal\scripts\ci_prepare_windows.bat

- name: Run cargo build
run: cargo build --workspace --all-targets

- name: Run cargo test
run: cargo test --workspace --no-fail-fast

ubuntu-stable-debug:
needs: [preflight-check, preflight-check-linux]
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy

- name: Prepare system
run: ./internal/scripts/ci_prepare_ubuntu.sh

- name: Run cargo fmt
run: cargo fmt --all -- --check

- name: Run cargo clippy
run: cargo clippy -- -D warnings

- name: Run cargo build
run: cargo build --workspace --all-targets

- name: Run cargo test
run: cargo test --workspace --no-fail-fast

ubuntu-stable-release:
needs: preflight-check
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy

- name: Prepare system
run: ./internal/scripts/ci_prepare_ubuntu.sh

- name: Run cargo build
run: cargo build --workspace --all-targets --release

- name: Run cargo test
run: cargo test --workspace --no-fail-fast --release

ubuntu-min-debug:
needs: preflight-check
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: 1.73.0
components: rustfmt, clippy

- name: Prepare system
run: ./internal/scripts/ci_prepare_ubuntu.sh

- name: Run cargo build
run: cargo build --workspace --all-targets

- name: Run cargo test
run: cargo test --workspace --no-fail-fast

ubuntu-min-release:
needs: preflight-check
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: 1.73.0
components: rustfmt, clippy

- name: Prepare system
run: ./internal/scripts/ci_prepare_ubuntu.sh

- name: Run cargo build
run: cargo build --workspace --all-targets --release

- name: Run cargo test
run: cargo test --workspace --no-fail-fast --release

ubuntu-beta-debug:
needs: preflight-check
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: beta
components: rustfmt, clippy

- name: Prepare system
run: ./internal/scripts/ci_prepare_ubuntu.sh

- name: Run cargo fmt
run: cargo fmt --all -- --check

- name: Run cargo clippy
run: cargo clippy -- -D warnings

- name: Run cargo build
run: cargo build --workspace --all-targets

- name: Run cargo test
run: cargo test --workspace --no-fail-fast

ubuntu-beta-release:
needs: preflight-check
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: beta
components: rustfmt, clippy

- name: Prepare system
run: ./internal/scripts/ci_prepare_ubuntu.sh

- name: Run cargo build
run: cargo build --workspace --all-targets --release

- name: Run cargo test
run: cargo test --workspace --no-fail-fast --release

ubuntu-nightly-debug:
needs: preflight-check
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
components: rustfmt, clippy

- name: Prepare system
run: ./internal/scripts/ci_prepare_ubuntu.sh

- name: Run cargo fmt
run: cargo fmt --all -- --check

- name: Run cargo clippy
run: cargo clippy -- -D warnings

- name: Run cargo build
run: cargo build --workspace --all-targets

- name: Run cargo test
run: cargo test --workspace --no-fail-fast

ubuntu-nightly-release:
needs: preflight-check
run: cargo test --workspace --no-fail-fast ${{ matrix.mode }}

ubuntu:
needs: [preflight-check, static-code-analysis]
strategy:
matrix:
toolchain: [stable, 1.73.0, beta, nightly]
mode: ["--release", ""]
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
Expand All @@ -294,17 +85,17 @@ jobs:
- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy

- name: Prepare system
run: ./internal/scripts/ci_prepare_ubuntu.sh

- name: Run cargo build
run: cargo build --workspace --all-targets --release
run: cargo build --workspace --all-targets ${{ matrix.mode }}

- name: Run cargo test
run: cargo test --workspace --no-fail-fast --release
run: cargo test --workspace --no-fail-fast ${{ matrix.mode }}

grcov:
needs: preflight-check
Expand Down

0 comments on commit c49f822

Please sign in to comment.