CI #3236
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
permissions: | |
contents: read | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- dev | |
schedule: | |
- cron: '0 2 * * *' | |
workflow_dispatch: | |
env: | |
CARGO_INCREMENTAL: 0 | |
CARGO_NET_GIT_FETCH_WITH_CLI: true | |
CARGO_NET_RETRY: 10 | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: 1 | |
RUST_TEST_THREADS: 1 | |
RUSTFLAGS: -D warnings | |
RUSTUP_MAX_RETRIES: 10 | |
CARGO_HACK_DENY_WARNINGS: 1 | |
defaults: | |
run: | |
shell: bash --noprofile --norc -CeEuxo pipefail {0} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
deny: | |
uses: taiki-e/github-actions/.github/workflows/deny.yml@main | |
miri: | |
uses: taiki-e/github-actions/.github/workflows/miri.yml@main | |
msrv: | |
uses: taiki-e/github-actions/.github/workflows/msrv.yml@main | |
with: | |
event_name: ${{ github.event_name }} | |
release-dry-run: | |
uses: taiki-e/github-actions/.github/workflows/release-dry-run.yml@main | |
tidy: | |
uses: taiki-e/github-actions/.github/workflows/tidy.yml@main | |
permissions: | |
contents: read | |
pull-requests: write # for gh pr edit --add-assignee | |
repository-projects: read # for gh pr edit --add-assignee | |
secrets: inherit | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- rust: stable | |
- rust: beta | |
- rust: nightly | |
- rust: nightly | |
os: macos-latest | |
- rust: nightly | |
os: windows-latest | |
runs-on: ${{ matrix.os || 'ubuntu-latest' }} | |
timeout-minutes: 60 | |
steps: | |
- uses: taiki-e/checkout-action@v1 | |
- uses: taiki-e/github-actions/install-rust@main | |
with: | |
toolchain: ${{ matrix.rust }} | |
- run: cargo test --workspace --all-features | |
- run: | | |
cargo install --path . --debug | |
cd -- tests/fixtures/real | |
cargo hack check --feature-powerset --workspace | |
cargo hack check --feature-powerset --workspace --message-format=json | |
cd -- ../rust-version | |
rustup toolchain remove 1.63 1.64 1.65 | |
cargo hack check --rust-version --workspace --locked | |
cargo uninstall cargo-hack | |
- uses: taiki-e/install-action@cargo-hack | |
- uses: taiki-e/install-action@cargo-minimal-versions | |
- run: cargo hack build --workspace --no-private --feature-powerset --no-dev-deps | |
- run: cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features | |
- run: cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features --direct | |
test-compat: | |
name: test (1.${{ matrix.rust }}) | |
strategy: | |
fail-fast: false | |
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 | |
- 30 | |
- 31 | |
- 36 | |
- 39 | |
- 41 | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: taiki-e/checkout-action@v1 | |
- uses: taiki-e/github-actions/install-rust@nightly | |
- run: CARGO_HACK_TEST_TOOLCHAIN=${{ matrix.rust }} cargo test --workspace --all-features | |
# Remove stable toolchain to disable https://github.com/taiki-e/cargo-hack/pull/138's behavior. | |
- run: rustup toolchain remove stable | |
- run: CARGO_HACK_TEST_TOOLCHAIN=${{ matrix.rust }} cargo test --workspace --all-features | |
test-no-rustup: | |
name: test (no rustup) | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
container: alpine | |
steps: | |
- uses: taiki-e/checkout-action@v1 | |
- name: Install Rust | |
run: apk --no-cache add cargo | |
- run: cargo test --workspace --all-features | |
- run: | | |
cargo install --path . --debug | |
cd -- tests/fixtures/real | |
cargo hack check --feature-powerset --workspace | |
cargo uninstall cargo-hack |