Skip to content

Commit

Permalink
Merge #109
Browse files Browse the repository at this point in the history
109: Improve testing for old cargo/rustc r=taiki-e a=taiki-e

This allows us to run the full test suite on cargo/rustc that is older than the version required for the building cargo-hack from the source.

Related: #71

Co-authored-by: Taiki Endo <te316e89@gmail.com>
  • Loading branch information
bors[bot] and taiki-e authored Jan 19, 2021
2 parents c621d51 + c820f8c commit 3338055
Show file tree
Hide file tree
Showing 50 changed files with 619 additions and 1,065 deletions.
64 changes: 31 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ jobs:
strategy:
matrix:
include:
- rust: 1.36
- rust: 1.39
- rust: 1.41
- rust: stable
- rust: beta
- rust: nightly
Expand All @@ -42,16 +39,36 @@ jobs:
- uses: taiki-e/github-actions/install-rust@main
with:
toolchain: ${{ matrix.rust }}
- if: startsWith(matrix.rust, 'nightly') && matrix.target == ''
run: cargo install cargo-hack
- if: matrix.target != ''
run: cargo install cross
- if: matrix.target != ''
run: cross test --target ${{ matrix.target }}
- if: matrix.target == ''
run: cargo test --all
- if: startsWith(matrix.rust, 'nightly') && matrix.target == ''
run: bash scripts/check-minimal-versions.sh
- run: cargo install cargo-hack
if: startsWith(matrix.rust, 'nightly') && matrix.target == ''
- run: cargo install cross
if: matrix.target != ''
- run: cross test --target ${{ matrix.target }}
if: matrix.target != ''
- run: cargo test --all
if: matrix.target == ''
- run: bash scripts/check-minimal-versions.sh
if: startsWith(matrix.rust, 'nightly') && matrix.target == ''

test-compat:
name: test (1.${{ matrix.rust }})
strategy:
matrix:
rust:
# cargo-hack is usually runnable with Cargo versions older than the Rust version required for installation.
# When updating this, the reminder to update the minimum supported Rust version in README.md.
- 26
- 31
- 36
- 39
- 41
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: taiki-e/github-actions/install-rust@main
with:
toolchain: stable
- run: CARGO_HACK_TEST_TOOLCHAIN=${{ matrix.rust }} cargo test --all

build:
strategy:
Expand All @@ -69,25 +86,6 @@ jobs:
- run: cargo install cargo-hack
- run: cargo hack build --all --ignore-private --no-dev-deps --version-range ${{ matrix.range }}

run:
strategy:
matrix:
rust:
# cargo-hack is usually runnable with Cargo versions older than the Rust version required for installation.
# When updating this, the reminder to update the minimum supported Rust version in README.md.
- 1.26
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: taiki-e/github-actions/install-rust@main
with:
toolchain: ${{ matrix.rust }}
- run: cargo +stable install --path .
- run: cargo hack check --manifest-path tests/fixtures/run/real/Cargo.toml
- run: cargo hack check --manifest-path tests/fixtures/run/virtual/Cargo.toml
- run: git diff --exit-code
- run: cargo hack --remove-dev-deps --manifest-path tests/fixtures/run/real/Cargo.toml

clippy:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -123,8 +121,8 @@ jobs:
if: github.event_name == 'push' && success()
needs:
- test
- test-compat
- build
- run
- clippy
- rustfmt
- shellcheck
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
target
Cargo.lock
!Cargo.lock

# For platform and editor specific settings, it is recommended to add to
# a global .gitignore file.
Expand Down
Loading

0 comments on commit 3338055

Please sign in to comment.