From 83e7da07ec2aa1da7f696ffc51d14097da86c176 Mon Sep 17 00:00:00 2001 From: Torben Hansing Date: Thu, 13 Jun 2024 10:31:08 +0200 Subject: [PATCH] Rename the build_and_test action to test --- .github/actions/{build_and_test => test}/action.yml | 13 +++++-------- .github/workflows/ci.yml | 11 +++++------ .github/workflows/publish.yml | 7 +++---- 3 files changed, 13 insertions(+), 18 deletions(-) rename .github/actions/{build_and_test => test}/action.yml (83%) diff --git a/.github/actions/build_and_test/action.yml b/.github/actions/test/action.yml similarity index 83% rename from .github/actions/build_and_test/action.yml rename to .github/actions/test/action.yml index 6ced846..c0738cc 100644 --- a/.github/actions/build_and_test/action.yml +++ b/.github/actions/test/action.yml @@ -1,5 +1,5 @@ -name: Build and Test -description: Build and test the rust application +name: Test +description: Build and test the Rust application inputs: rust-version: @@ -14,7 +14,7 @@ inputs: outputs: codecov-report: description: The path to the CodeCov coverage report - value: ${{ steps.run_tests.outputs.report-path }} + value: ${{ steps.tests.outputs.report-path }} runs: using: composite @@ -30,16 +30,13 @@ runs: with: toolchain: ${{ inputs.rust-version }} if: inputs.coverage != 'true' - - name: Install LLVM Tools + - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov if: inputs.coverage == 'true' - name: Install cargo-nextest uses: taiki-e/install-action@nextest - - name: Build - shell: bash - run: cargo build --verbose - name: Test - id: run_tests + id: tests env: REPORT_PATH: coverage.xml shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d6723b..e719d27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,8 +60,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/build_and_test - id: build_and_test + - uses: ./.github/actions/test + id: coverage with: rust-version: nightly coverage: 'true' @@ -69,14 +69,13 @@ jobs: uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} - file: ${{ steps.build_and_test.outputs.codecov }} + file: ${{ steps.coverage.outputs.codecov }} - build_and_test: + test: needs: [msrv] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/build_and_test - id: build_and_test + - uses: ./.github/actions/test with: rust-version: "${{ needs.msrv.outputs.msrv }}" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e5df744..07c7453 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -29,20 +29,19 @@ jobs: - uses: ./.github/actions/msrv id: msrv - build_and_test: + test: needs: [msrv] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/build_and_test - id: build_and_test + - uses: ./.github/actions/test with: rust-version: "${{ needs.msrv.outputs.msrv }}" publish: name: Publish runs-on: ubuntu-latest - needs: [check-version, audit, build_and_test] + needs: [check-version, audit, test] steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable