CI #1390
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 | |
RUSTFLAGS: -D warnings | |
RUSTUP_MAX_RETRIES: 10 | |
CARGO_MINIMAL_VERSIONS_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 }} | |
- uses: taiki-e/install-action@cargo-hack | |
- uses: taiki-e/install-action@cargo-minimal-versions | |
- run: cargo test --workspace --all-features | |
- 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 | |
- run: cargo install -f --path . --debug | |
- run: cargo minimal-versions check --workspace --no-private --detach-path-deps=skip-exact --all-features -v | |
- run: cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features -v | |
- run: cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features -v --direct | |
- run: cargo minimal-versions test --workspace --all-features -v | |
- run: | | |
retry() { | |
for i in {1..10}; do | |
if "$@"; then | |
return 0 | |
else | |
sleep "${i}" | |
fi | |
done | |
"$@" | |
} | |
retry git clone --depth 1 https://github.com/taiki-e/portable-atomic.git | |
cd -- portable-atomic | |
toolchain=1.34 | |
if [[ "${{ matrix.os }}" == "macos"* ]]; then | |
toolchain=1.54 # https://github.com/rust-lang/rust/issues/105167 | |
fi | |
retry rustup toolchain add "${toolchain}" --no-self-update | |
RUSTC_BOOTSTRAP=1 cargo +"${toolchain}" minimal-versions build --workspace --no-private -v | |
RUSTC_BOOTSTRAP=1 cargo +"${toolchain}" minimal-versions build --workspace --no-private --detach-path-deps=all -v | |
if: startsWith(matrix.rust, 'nightly') | |
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 | |
- uses: taiki-e/install-action@cargo-hack | |
- run: cargo test --workspace --all-features | |
- run: cargo install -f --path . --debug | |
- run: cargo minimal-versions check --workspace --no-private --detach-path-deps=skip-exact --all-features -v | |
- run: cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features -v | |
- run: cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features -v --direct | |
- run: cargo minimal-versions test --workspace --all-features -v |