Skip to content

Commit

Permalink
Merge pull request #17 from artichoke/lopopolo/audit-toolchain
Browse files Browse the repository at this point in the history
Add setup-rust/audit to setup for cargo-deny
  • Loading branch information
lopopolo authored Dec 7, 2022
2 parents c4ff6f4 + e7094fa commit 0c28307
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
@@ -1,4 +1,7 @@
---
- name: "A-audit"
color: "f7e101"
description: "Area: Audit configurable toolchain."
- name: "A-build"
color: "f7e101"
description: "Area: CI build infrastructure."
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ name: CI
schedule:
- cron: "0 0 * * TUE"
jobs:
test-setup-audit-toolchain:
name: Test setup audit 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/audit

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

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

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

- 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 0c28307

Please sign in to comment.