Skip to content

Commit

Permalink
Test on min rust version and nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
bash committed May 18, 2024
1 parent 45290eb commit e88b1a7
Showing 1 changed file with 39 additions and 9 deletions.
48 changes: 39 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,55 @@ env:
RUSTFLAGS: -Dwarnings

jobs:
pre-build:
name: Pre-Build
runs-on: ubuntu-latest
outputs:
rust-version: ${{ steps.rust-version.outputs.rust-version }}
steps:
- uses: actions/checkout@v4
- name: Determine Rust Version
id: rust-version
run: |
rust_version=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name == "terminal-trx") | .rust_version')
echo "rust-version=$rust_version" >> "$GITHUB_OUTPUT"
build:
needs: pre-build
name: ${{ format('Build ({0})', matrix.rust-version) }}
runs-on: ubuntu-latest

strategy:
matrix:
rust-version: ['${{needs.pre-build.outputs.rust-version}}', stable, nightly]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Rust ${{matrix.rust-version}}
if: matrix.rust-version != 'stable'
run: rustup override set '${{matrix.rust-version}}'
- name: Ensure rustfmt is installed
run: rustup component add rustfmt
if: matrix.rust-version != 'stable'
- name: Build
run: cargo build
- name: Check format
run: cargo fmt -- --check
- name: Run clippy
run: cargo clippy --workspace --all-targets --all-features -- --deny warnings
run: cargo build --all-features
- name: Check fallback implementation
run: cargo check --workspace --features __test_unsupported
- name: Docs
run: cargo doc --all-features
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v4
- name: Check format
run: cargo fmt -- --check
- name: Run clippy
run: cargo clippy --workspace --all-targets --all-features -- --deny warnings
test:
name: Test
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run tests
run: cargo test
run: cargo test --workspace --all-features

0 comments on commit e88b1a7

Please sign in to comment.