From 07f6778725e31a95276f93898fa1905252d44ee3 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Thu, 27 Jul 2023 00:43:03 +0200 Subject: [PATCH] GitHub CI: Update and rename actions --- ...s-integration.yaml => build-and-test.yaml} | 33 ++++++++----------- .github/workflows/pre-commit.yaml | 4 ++- .github/workflows/pre-release.yaml | 6 ++-- .github/workflows/security-audit.yaml | 4 ++- 4 files changed, 24 insertions(+), 23 deletions(-) rename .github/workflows/{continuous-integration.yaml => build-and-test.yaml} (85%) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/build-and-test.yaml similarity index 85% rename from .github/workflows/continuous-integration.yaml rename to .github/workflows/build-and-test.yaml index 43f540bf..d7fe25ba 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/build-and-test.yaml @@ -3,7 +3,7 @@ # yaml-language-server: $schema=https://json.schemastore.org/github-workflow -name: continuous-integration +name: build-and-test permissions: contents: read @@ -22,23 +22,20 @@ env: RUST_BACKTRACE: short jobs: - continuous-integration: - name: Building workspace projects and running tests + build-and-test: runs-on: ${{ matrix.runner_os }} strategy: matrix: - target: - - x86_64-unknown-linux-musl include: - - target: x86_64-unknown-linux-musl - runner_os: ubuntu-latest - - target: x86_64-apple-darwin + - target: aarch64-apple-darwin runner_os: macos-latest - target: x86_64-pc-windows-msvc runner_os: windows-latest + - target: x86_64-unknown-linux-musl + runner_os: ubuntu-latest steps: - - name: Install dependencies for `musl libc` on Linux + - name: Install dependencies for musl libc if: matrix.target == 'x86_64-unknown-linux-musl' run: | sudo apt -y install musl-tools @@ -60,14 +57,16 @@ jobs: with: targets: ${{ matrix.target }}, wasm32-unknown-unknown + # Checkout the repository before the remaining steps that depend on it. + # All preceding steps are independent of the repository contents. - name: Check out repository uses: actions/checkout@v3 - name: Cache Rust toolchain and build artifacts uses: Swatinem/rust-cache@v2 with: - # Distinguished by the action name to avoid sharing across different actions! - shared-key: "continuous-integration" + # Distinguished by the action name to avoid sharing between different actions. + shared-key: "build-and-test" - name: Check aoide-core run: | @@ -141,14 +140,10 @@ jobs: run: | cargo check --locked --all-targets --all-features --manifest-path webcli/Cargo.toml - - name: Build tests with default features - run: | - cargo test --locked --workspace --all-targets --no-run - - - name: Run tests with default features + - name: Build tests with all features enabled run: | - cargo test --locked --workspace --all-targets -- --nocapture --quiet + cargo test --locked --workspace --all-targets --all-features --no-run - - name: Build workspace with profile `production` and default features + - name: Run tests with all features enabled run: | - cargo build --locked --workspace --all-targets --profile production + cargo test --locked --workspace --all-targets --all-features -- --nocapture --quiet diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index fb78c67e..48aeab5d 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -33,13 +33,15 @@ jobs: with: components: clippy, rustfmt + # Checkout the repository before the remaining steps that depend on it. + # All preceding steps are independent of the repository contents. - name: Check out repository uses: actions/checkout@v3 - name: Cache Rust toolchain and build artifacts uses: Swatinem/rust-cache@v2 with: - # Distinguished by the action name to avoid sharing across different actions! + # Distinguished by the action name to avoid sharing between different actions. shared-key: "pre-commit" - name: Detect code style issues (push) diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index b7f35047..27e024c6 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -57,18 +57,20 @@ jobs: run: | echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - name: Install native Rust toolchain + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} + # Checkout the repository before the remaining steps that depend on it. + # All preceding steps are independent of the repository contents. - name: Check out repository uses: actions/checkout@v3 - name: Cache Rust toolchain and build artifacts uses: Swatinem/rust-cache@v2 with: - # Distinguished by the action name to avoid sharing across different actions! + # Distinguished by the action name to avoid sharing between different actions. shared-key: "pre-release" - name: Build artifact diff --git a/.github/workflows/security-audit.yaml b/.github/workflows/security-audit.yaml index 84e8e82d..64c481cf 100644 --- a/.github/workflows/security-audit.yaml +++ b/.github/workflows/security-audit.yaml @@ -28,12 +28,14 @@ jobs: run: | cargo install cargo-audit + # Checkout the repository before the remaining steps that depend on it. + # All preceding steps are independent of the repository contents. - uses: actions/checkout@v3 - name: Cache Rust toolchain and build artifacts uses: Swatinem/rust-cache@v2 with: - # Distinguished by the action name to avoid sharing across different actions! + # Distinguished by the action name to avoid sharing between different actions. shared-key: "security-audit" - name: Run security audit