-
-
Notifications
You must be signed in to change notification settings - Fork 38
130 lines (121 loc) · 3.98 KB
/
ci.yml
File metadata and controls
130 lines (121 loc) · 3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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:
miri:
uses: taiki-e/github-actions/.github/workflows/miri.yml@main
msrv:
uses: taiki-e/github-actions/.github/workflows/msrv.yml@main
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: write # for creating branch for pr
pull-requests: write # unused (used in `codegen-automerge: true` case)
security-events: write # for github/codeql-action/*
secrets:
PR_TOKEN_APP_PRIVATE_KEY: ${{ secrets.PR_TOKEN_APP_PRIVATE_KEY }}
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@v2
with:
tool: cargo-hack,cargo-minimal-versions
fallback: none
- 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 test --workspace --all-features
env:
CARGO_HACK_TEST_TOOLCHAIN: ${{ matrix.rust }}
# Remove stable toolchain to disable https://github.com/taiki-e/cargo-hack/pull/138's behavior.
- run: rustup toolchain remove stable
- run: cargo test --workspace --all-features
env:
CARGO_HACK_TEST_TOOLCHAIN: ${{ matrix.rust }}
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