Skip to content

[#72] reduce rust version to minimum required #109

[#72] reduce rust version to minimum required

[#72] reduce rust version to minimum required #109

Workflow file for this run

name: Unit-Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main, release* ]
jobs:
preflight-check:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Check format of all commit messages
run: ./internal/scripts/ci_test_commit_msg.sh
- name: Check license header
run: ./internal/scripts/ci_test_spdx_license_header.sh
windows-stable:
needs: preflight-check
timeout-minutes: 10
runs-on: windows-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- name: Prepare system
run: |
mkdir "C:\Temp\iceoryx2\services"
mkdir "C:\Temp\iceoryx2\tests"
mkdir "C:\Temp\iceoryx2\shm"
icacls "C:\Temp" /t /c /grant Everyone:F
- 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
windows-min-version:
needs: preflight-check
timeout-minutes: 10
runs-on: windows-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: 1.65.0
components: rustfmt, clippy
- name: Prepare system
run: |
mkdir "C:\Temp\iceoryx2\services"
mkdir "C:\Temp\iceoryx2\tests"
mkdir "C:\Temp\iceoryx2\shm"
icacls "C:\Temp" /t /c /grant Everyone:F
- 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
grcov:
needs: preflight-check
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and cache grcov
uses: ./.github/actions/build-and-cache-rust-tool
with:
rust-toolchain: stable
rust-components: llvm-tools-preview
check-and-install-cmd: grcov --version > /dev/null || cargo install grcov
print-version-cmd: grcov --version
cache-key: cache-1-${{ runner.os }}-grcov
artifact-path: ~/.cargo/bin/grcov
artifact-name: ${{ runner.os }}-grcov
coverage:
needs: grcov
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get -y install libacl1-dev llvm
- name: Create test users and groups
run: |
sudo useradd testuser1
sudo useradd testuser2
sudo groupadd testgroup1
sudo groupadd testgroup2
- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
components: llvm-tools-preview
- name: Download artifact grcov
uses: actions/download-artifact@v3
with:
name: ${{ runner.os }}-grcov
path: ~/.cargo/bin
- name: Make grcov artifacts executable
run: chmod +x ~/.cargo/bin/grcov
- name: Generate raw coverage results
run: ./internal/scripts/generate-cov-report.sh --generate
- name: Generate coverage results for html artifacts
run: ./internal/scripts/generate-cov-report.sh --html
- name: Archive coverage-html artifacts
uses: actions/upload-artifact@v3
with:
name: coverage-html
path: target/debug/coverage/html/*
retention-days: 90
- name: Generate coverage report for Codecov
run: ./internal/scripts/generate-cov-report.sh --lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: target/debug/coverage/lcov.info
fail_ci_if_error: true