Skip to content

Commit

Permalink
Merge pull request #18 from artichoke/lopopolo/code-coverage-action
Browse files Browse the repository at this point in the history
Add action to setup code coverage with nightly rust and llvm tools
  • Loading branch information
lopopolo authored Dec 21, 2022
2 parents 0c28307 + 2566656 commit f7679da
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
- name: "A-build-and-test"
color: "f7e101"
description: "Area: Build and test configurable toolchain."
- name: "A-code-coverage"
color: "f7e101"
description: "Area: Code coverage configurable toolchain."
- name: "A-deps"
color: "f7e101"
description: "Area: Source and library dependencies."
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,22 @@ jobs:
- name: Check that nightly toolchain is installed
run: rustc +nightly -Vv

test-setup-code-coverage-toolchain:
name: Test setup code coverage toolchain action
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
path: setup-rust-action

- name: Setup stable audit toolchain
uses: ./setup-rust-action/code-coverage

- name: Check that active toolchain is stable
run: |
[[ "$(rustup show active-toolchain)" == nightly-* ]]
test-setup-lint-and-format-toolchain:
name: Test setup lint and format toolchain action
runs-on: ubuntu-latest
Expand Down
37 changes: 37 additions & 0 deletions code-coverage/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: "Audit Toolchain"
description: "Setup a nightly Rust toolchain with llvm-tools so code coverage works"

inputs:
toolchain:
description: "Rustup toolchain"
required: true
default: "nightly"

runs:
using: "composite"
steps:
- name: Install ${{ inputs.toolchain }} toolchain
shell: bash
run: rustup toolchain install "${{ inputs.toolchain }}" --profile minimal --component llvm-tools-preview

- name: Update ${{ inputs.toolchain }} toolchain
shell: bash
run: rustup update "${{ inputs.toolchain }}"

- name: Set default toolchain to ${{ inputs.toolchain }}
shell: bash
# https://rust-lang.github.io/rustup/overrides.html
run: echo 'RUSTUP_TOOLCHAIN=${{ inputs.toolchain }}' >> "$GITHUB_ENV"

- name: Show rustup version
shell: bash
run: rustup -Vv

- name: Show ${{ inputs.toolchain }} rustc version
shell: bash
run: rustc +${{ inputs.toolchain }} -Vv

- name: Show ${{ inputs.toolchain }} cargo version
shell: bash
run: cargo +${{ inputs.toolchain }} version --verbose

0 comments on commit f7679da

Please sign in to comment.