Skip to content

Commit

Permalink
Merge pull request #36 from artichoke/lopopolo/setup-miri
Browse files Browse the repository at this point in the history
Add setup miri action
  • Loading branch information
lopopolo authored Apr 11, 2023
2 parents cf131cc + a65ef79 commit 30d1be4
Show file tree
Hide file tree
Showing 3 changed files with 60 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 @@ -23,6 +23,9 @@
- name: "A-minimal-versions"
color: "f7e101"
description: "Area: Minimal versions configurable and nightly toolchain."
- name: "A-miri"
color: "f7e101"
description: "Area: Miri configurable toolchain."
- name: "A-performance"
color: "f7e101"
description: "Area: Performance improvements and optimizations."
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,22 @@ jobs:
- name: Check that nightly rustfmt is installed
run: cargo +nightly fmt --version --verbose

test-setup-miri-toolchain:
name: Test setup miri 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/miri

- name: Check that active toolchain is nightly
run: |
[[ "$(rustup show active-toolchain)" == nightly-* ]]
test-setup-rustdoc-toolchain:
name: Test setup rustdoc toolchain action
runs-on: ubuntu-latest
Expand Down
41 changes: 41 additions & 0 deletions miri/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: "Miri Toolchain"
description: "Setup a nightly Rust toolchain with miri and rust-src so testing with Miri 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 miri --component rust-src

- 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

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

0 comments on commit 30d1be4

Please sign in to comment.