@@ -25,114 +25,174 @@ env:
25
25
26
26
defaults :
27
27
run :
28
- shell : bash
28
+ shell : bash --noprofile --norc -CeEuxo pipefail {0}
29
29
30
30
concurrency :
31
31
group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
32
32
cancel-in-progress : true
33
33
34
34
jobs :
35
- deny :
36
- uses : taiki-e/github-actions/.github/workflows/deny.yml@main
37
- miri :
38
- uses : taiki-e/github-actions/.github/workflows/miri.yml@main
39
- msrv :
40
- uses : taiki-e/github-actions/.github/workflows/msrv.yml@main
41
- with :
42
- event_name : ${{ github.event_name }}
43
- release-dry-run :
44
- uses : taiki-e/github-actions/.github/workflows/release-dry-run.yml@main
45
- tidy :
46
- uses : taiki-e/github-actions/.github/workflows/tidy.yml@main
35
+ # deny:
36
+ # uses: taiki-e/github-actions/.github/workflows/deny.yml@main
37
+ # miri:
38
+ # uses: taiki-e/github-actions/.github/workflows/miri.yml@main
39
+ # msrv:
40
+ # uses: taiki-e/github-actions/.github/workflows/msrv.yml@main
41
+ # with:
42
+ # event_name: ${{ github.event_name }}
43
+ # release-dry-run:
44
+ # uses: taiki-e/github-actions/.github/workflows/release-dry-run.yml@main
45
+ # tidy:
46
+ # uses: taiki-e/github-actions/.github/workflows/tidy.yml@main
47
47
48
- test :
48
+ # test:
49
+ # strategy:
50
+ # fail-fast: false
51
+ # matrix:
52
+ # include:
53
+ # # TODO: nightly-2023-04-27 (https://github.com/rust-lang/rust/pull/97368)
54
+ # # and nightly-2023-05-03 (https://github.com/rust-lang/rust/pull/111042)
55
+ # # fixed bugs in report generation, so the latest report is not the
56
+ # # same as the old report.
57
+ # # - rust: '1.60'
58
+ # - rust: stable
59
+ # - rust: beta
60
+ # - rust: nightly
61
+ # - rust: nightly
62
+ # os: macos-latest
63
+ # - rust: nightly
64
+ # os: windows-latest
65
+ # runs-on: ${{ matrix.os || 'ubuntu-latest' }}
66
+ # timeout-minutes: 60
67
+ # steps:
68
+ # - uses: taiki-e/checkout-action@v1
69
+ # - name: Install Rust
70
+ # run: rustup toolchain add "${{ matrix.rust }}" --no-self-update && rustup default "${{ matrix.rust }}"
71
+ # - run: rustup toolchain add nightly --no-self-update
72
+ # - uses: taiki-e/install-action@cargo-hack
73
+ # - uses: taiki-e/install-action@cargo-minimal-versions
74
+ # - uses: taiki-e/install-action@nextest
75
+ # - run: cargo test --workspace --all-features
76
+ # # TODO: move this test to tests/test.rs
77
+ # - run: cargo install --path . --debug
78
+ # - name: Test cargo llvm-cov nextest
79
+ # run: |
80
+ # cargo llvm-cov nextest --text --fail-under-lines 50
81
+ # cargo llvm-cov nextest --text --fail-under-lines 50 --profile default --cargo-profile dev
82
+ # cargo llvm-cov nextest --text --fail-under-lines 50 --profile ci
83
+ # cargo llvm-cov nextest --text --fail-under-lines 50 --profile ci --cargo-profile dev
84
+ # cd -- ../real1
85
+ # cargo llvm-cov nextest-archive --archive-file a.tar.zst
86
+ # cargo llvm-cov nextest --archive-file a.tar.zst --text --fail-under-lines 70
87
+ # cargo llvm-cov report --nextest-archive-file a.tar.zst --fail-under-lines 70
88
+ # rm -- a.tar.zst
89
+ # cargo clean
90
+ # cargo llvm-cov nextest-archive --archive-file a.tar.zst --release
91
+ # cargo llvm-cov nextest --archive-file a.tar.zst --text --fail-under-lines 70
92
+ # cargo llvm-cov report --nextest-archive-file a.tar.zst --fail-under-lines 70
93
+ # rm -- a.tar.zst
94
+ # cargo clean
95
+ # cargo llvm-cov nextest-archive --archive-file a.tar.zst --cargo-profile custom
96
+ # cargo llvm-cov nextest --archive-file a.tar.zst --text --fail-under-lines 70
97
+ # cargo llvm-cov report --nextest-archive-file a.tar.zst --fail-under-lines 70
98
+ # rm -- a.tar.zst
99
+ # cargo clean
100
+ # host=$(rustc -vV | grep -E '^host:' | cut -d' ' -f2)
101
+ # cargo llvm-cov nextest-archive --archive-file a.tar.zst --target "${host}"
102
+ # cargo llvm-cov nextest --archive-file a.tar.zst --text --fail-under-lines 70
103
+ # cargo llvm-cov report --nextest-archive-file a.tar.zst --fail-under-lines 70
104
+ # working-directory: tests/fixtures/crates/bin_crate
105
+ # - name: Test nightly-specific options, old Cargo compatibility, trybuild compatibility
106
+ # run: |
107
+ # unset RUSTFLAGS
108
+
109
+ # # Test nightly-specific options
110
+ # git clone https://github.com/taiki-e/easytime.git
111
+ # pushd -- easytime >/dev/null
112
+ # git checkout 7ecb6e6
113
+ # cargo llvm-cov test --doctests --text --fail-under-lines 30
114
+ # popd >/dev/null
115
+ # pushd -- tests/fixtures/crates/cargo_config >/dev/null
116
+ # # TODO: --fail-under-branches?
117
+ # cargo llvm-cov test --branch --text --fail-under-lines 80
118
+ # popd >/dev/null
119
+ # pushd -- easytime >/dev/null
120
+ # cargo llvm-cov test --branch --doctests --text --fail-under-lines 30
121
+ # popd >/dev/null
122
+
123
+ # # Test minimum runnable Cargo version.
124
+ # rustup toolchain add 1.60 --no-self-update
125
+ # pushd -- easytime >/dev/null
126
+ # cargo +1.60 llvm-cov test --text --fail-under-lines 30
127
+ # popd >/dev/null
128
+
129
+ # # Test trybuild compatibility.
130
+ # git clone --depth 1 https://github.com/taiki-e/easy-ext.git
131
+ # pushd -- easy-ext >/dev/null
132
+ # cargo llvm-cov --text --test compiletest --fail-under-lines 70
133
+ # popd >/dev/null
134
+ # if: startsWith(matrix.rust, 'nightly')
135
+ # - run: cargo hack build --workspace --no-private --feature-powerset --no-dev-deps
136
+ # - run: cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features
137
+
138
+ test-ffi :
49
139
strategy :
50
140
fail-fast : false
51
141
matrix :
52
142
include :
53
- # TODO: nightly-2023-04-27 (https://github.com/rust-lang/rust/pull/97368)
54
- # and nightly-2023-05-03 (https://github.com/rust-lang/rust/pull/111042)
55
- # fixed bugs in report generation, so the latest report is not the
56
- # same as the old report.
57
- # - rust: '1.60'
58
- - rust : stable
59
- - rust : beta
60
- - rust : nightly
61
- - rust : nightly
62
- os : macos-latest
63
- - rust : nightly
64
- os : windows-latest
65
- runs-on : ${{ matrix.os || 'ubuntu-latest' }}
143
+ # https://github.com/rust-lang/rust/blob/1.60.0/src/bootstrap/native.rs#L403
144
+ - llvm : ' 12'
145
+ - llvm : ' 13'
146
+ - llvm : ' 14'
147
+ - llvm : ' 15'
148
+ - llvm : ' 16'
149
+ - llvm : ' 17'
150
+ - llvm : ' 18'
151
+ runs-on : ubuntu-latest
66
152
timeout-minutes : 60
67
153
steps :
68
154
- uses : taiki-e/checkout-action@v1
69
155
- name : Install Rust
70
- run : rustup toolchain add ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
71
- - run : rustup toolchain add nightly --no-self-update
72
- - uses : taiki-e/install-action@cargo-hack
73
- - uses : taiki-e/install-action@cargo-minimal-versions
74
- - uses : taiki-e/install-action@nextest
75
- - run : cargo test --workspace --all-features
76
- # TODO: move this test to tests/test.rs
156
+ run : rustup update stable --no-self-update
157
+ - name : Install LLVM
158
+ run : |
159
+ if type -P clang-"${{ matrix.llvm }}" &>/dev/null; then
160
+ exit 0
161
+ fi
162
+ codename=$(grep -E '^VERSION_CODENAME=' /etc/os-release | cut -d= -f2)
163
+ sudo mkdir -pm755 -- /etc/apt/keyrings
164
+ curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused https://apt.llvm.org/llvm-snapshot.gpg.key \
165
+ | gpg --dearmor \
166
+ | sudo tee -- /etc/apt/keyrings/llvm-snapshot.gpg >/dev/null
167
+ echo "deb [signed-by=/etc/apt/keyrings/llvm-snapshot.gpg] http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${{ matrix.llvm }} main" \
168
+ | sudo tee -- "/etc/apt/sources.list.d/llvm-toolchain-${codename}-${{ matrix.llvm }}.list" >/dev/null
169
+ sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends \
170
+ clang-"${{ matrix.llvm }}" \
171
+ libc++-"${{ matrix.llvm }}"-dev \
172
+ libc++abi-"${{ matrix.llvm }}"-dev \
173
+ libclang-"${{ matrix.llvm }}"-dev \
174
+ lld-"${{ matrix.llvm }}" \
175
+ llvm-"${{ matrix.llvm }}" \
176
+ llvm-"${{ matrix.llvm }}"-dev
77
177
- run : cargo install --path . --debug
78
- - name : Test cargo llvm-cov nextest
178
+ - name : Test
79
179
run : |
80
- set -eEuxo pipefail
81
- cargo llvm-cov nextest --text --fail-under-lines 50
82
- cargo llvm-cov nextest --text --fail-under-lines 50 --profile default --cargo-profile dev
83
- cargo llvm-cov nextest --text --fail-under-lines 50 --profile ci
84
- cargo llvm-cov nextest --text --fail-under-lines 50 --profile ci --cargo-profile dev
85
- cd ../real1
86
- cargo llvm-cov nextest-archive --archive-file a.tar.zst
87
- cargo llvm-cov nextest --archive-file a.tar.zst --text --fail-under-lines 70
88
- cargo llvm-cov report --nextest-archive-file a.tar.zst --fail-under-lines 70
89
- rm a.tar.zst
180
+ export CC="clang-${{ matrix.llvm }}"
181
+ export CXX="clang++-${{ matrix.llvm }}"
182
+ export LLVM_COV=" llvm-cov-${{ matrix.llvm }}"
183
+ export LLVM_PROFDATA=" llvm-profdata-${{ matrix.llvm }}"
184
+ # LLVM 14 1.60-1.64
185
+ # LLVM 15 1.65-1.69
186
+ # LLVM 16 1.70-1.72
187
+ # LLVM 17 1.73-1.77
188
+ # LLVM 18 1.78-
189
+ rustup toolchain add 1.60 1.65 1.70 1.73 --no-self-update
90
190
cargo clean
91
- cargo llvm-cov nextest-archive --archive-file a.tar.zst --release
92
- cargo llvm-cov nextest --archive-file a.tar.zst --text --fail-under-lines 70
93
- cargo llvm-cov report --nextest-archive-file a.tar.zst --fail-under-lines 70
94
- rm a.tar.zst
191
+ cargo +1.60 llvm-cov test --text --include-ffi --fail-under-lines 70 -vv
95
192
cargo clean
96
- cargo llvm-cov nextest-archive --archive-file a.tar.zst --cargo-profile custom
97
- cargo llvm-cov nextest --archive-file a.tar.zst --text --fail-under-lines 70
98
- cargo llvm-cov report --nextest-archive-file a.tar.zst --fail-under-lines 70
99
- rm a.tar.zst
193
+ cargo +1.65 llvm-cov test --text --include-ffi --fail-under-lines 70 -vv
100
194
cargo clean
101
- host=$(rustc -vV | grep '^host:' | cut -d' ' -f2)
102
- cargo llvm-cov nextest-archive --archive-file a.tar.zst --target "${host}"
103
- cargo llvm-cov nextest --archive-file a.tar.zst --text --fail-under-lines 70
104
- cargo llvm-cov report --nextest-archive-file a.tar.zst --fail-under-lines 70
105
- working-directory : tests/fixtures/crates/bin_crate
106
- - name : Test nightly-specific options, old Cargo compatibility, trybuild compatibility
107
- run : |
108
- set -eEuxo pipefail
109
- unset RUSTFLAGS
110
-
111
- # Test nightly-specific options
112
- git clone https://github.com/taiki-e/easytime.git
113
- pushd easytime >/dev/null
114
- git checkout 7ecb6e6
115
- cargo llvm-cov test --doctests --text --fail-under-lines 30
116
- popd >/dev/null
117
- pushd tests/fixtures/crates/cargo_config >/dev/null
118
- # TODO: --fail-under-branches?
119
- cargo llvm-cov test --branch --text --fail-under-lines 80
120
- popd >/dev/null
121
- pushd easytime >/dev/null
122
- cargo llvm-cov test --branch --doctests --text --fail-under-lines 30
123
- popd >/dev/null
124
-
125
- # Test minimum runnable Cargo version.
126
- rustup toolchain add 1.60 --no-self-update
127
- pushd easytime >/dev/null
128
- cargo +1.60 llvm-cov test --text --fail-under-lines 30
129
- popd >/dev/null
130
-
131
- # Test trybuild compatibility.
132
- git clone --depth 1 https://github.com/taiki-e/easy-ext.git
133
- pushd easy-ext >/dev/null
134
- cargo llvm-cov --text --test compiletest --fail-under-lines 70
135
- popd >/dev/null
136
- if : startsWith(matrix.rust, 'nightly')
137
- - run : cargo hack build --workspace --no-private --feature-powerset --no-dev-deps
138
- - run : cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features
195
+ cargo +1.70 llvm-cov test --text --include-ffi --fail-under-lines 70 -vv
196
+ cargo clean
197
+ cargo +1.73 llvm-cov test --text --include-ffi --fail-under-lines 70 -vv
198
+ working-directory : tests/fixtures/crates/ffi
0 commit comments