Skip to content

Commit

Permalink
ci: Update to test stable configurations and MSRV
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Richey <joerichey@google.com>
  • Loading branch information
josephlr committed Mar 26, 2022
1 parent 9711eb7 commit 61316a8
Showing 1 changed file with 88 additions and 64 deletions.
152 changes: 88 additions & 64 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,56 @@ on:
pull_request:

jobs:
stable:
name: "Test Stable"
strategy:
matrix:
rust:
- nightly
- 1.59
- 1.57
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Run cargo build for stable
if: matrix.rust != 1.57
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features --features instructions
- name: Run cargo build for stable without instructions
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features
- name: Run cargo doc for stable
if: matrix.rust != 1.57
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-default-features --features instructions
- name: Run cargo doc for stable without instructions
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-default-features
- name: Run cargo test for stable
if: matrix.rust != 1.57
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features instructions
- name: Run cargo test for stable without instructions
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features

test:
name: "Test"

Expand All @@ -27,23 +77,13 @@ jobs:
timeout-minutes: 15

steps:
- name: "Checkout Repository"
uses: actions/checkout@v1

- name: Install Rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
if: runner.os == 'macOS'

- name: Set Rustup profile to minimal
run: rustup set profile minimal

- name: Install musl target on Linux
run: |
rustup target add x86_64-unknown-linux-musl
sudo apt-get install musl-tools musl-dev
if: runner.os == 'Linux'
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
target: x86_64-unknown-linux-musl

- name: "Print Rust Version"
run: |
Expand All @@ -60,56 +100,23 @@ jobs:
with:
command: doc

- name: "Run cargo doc for stable"
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-default-features --features instructions
if: runner.os != 'Windows'

- name: "Run cargo doc without default features"
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-default-features

- name: "Run cargo build for stable without instructions"
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features

- name: "Run cargo build for stable"
- name: "Run cargo build on musl"
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features --features instructions
if: runner.os != 'Windows'

- name: "Run cargo build for stable on musl"
uses: actions-rs/cargo@v1
with:
command: build
args: --target x86_64-unknown-linux-musl --no-default-features --features instructions
args: --target x86_64-unknown-linux-musl
if: runner.os == 'Linux'

- name: "Run cargo test"
uses: actions-rs/cargo@v1
with:
command: test

- name: "Run cargo test for stable"
- name: "Run cargo test on musl"
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features instructions
if: runner.os != 'Windows'

- name: "Run cargo test for stable on musl"
uses: actions-rs/cargo@v1
with:
command: test
args: --target x86_64-unknown-linux-musl --no-default-features --features instructions
args: --target x86_64-unknown-linux-musl
if: runner.os == 'Linux'

- name: "Install Rustup Targets"
Expand Down Expand Up @@ -138,11 +145,11 @@ jobs:

steps:
- name: "Checkout Repository"
uses: actions/checkout@v1
uses: actions/checkout@v3

- name: Cache binaries
id: cache-bin
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: binaries
key: ${{ runner.OS }}-binaries
Expand All @@ -151,7 +158,12 @@ jobs:
shell: bash

- name: "Install Rustup Components"
run: rustup component add rust-src llvm-tools-preview
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
components: rust-src llvm-tools-preview
- name: "Install cargo-xbuild"
run: cargo install cargo-xbuild --debug --root binaries
- name: "Install bootimage"
Expand Down Expand Up @@ -189,18 +201,30 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v1
- run: rustup toolchain install nightly --profile minimal --component rustfmt
- run: cargo +nightly fmt -- --check
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: "Clippy"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v1
- run: rustup toolchain install nightly --profile minimal --component clippy
- name: "Run `cargo clippy`"
uses: actions-rs/cargo@v1
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
components: clippy
- uses: actions-rs/cargo@v1
with:
command: clippy

0 comments on commit 61316a8

Please sign in to comment.