Skip to content

Commit

Permalink
Rename the build_and_test action to test
Browse files Browse the repository at this point in the history
  • Loading branch information
hansingt committed Jun 13, 2024
1 parent 3b4e636 commit a3d3602
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,22 @@ 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'
- name: Upload coverage report to Codecov
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
with:
rust-version: "${{ needs.msrv.outputs.msrv }}"
7 changes: 3 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a3d3602

Please # to comment.