Skip to content

Commit 555c549

Browse files
authored
Merge pull request #27 from qryxip/ja-all-enabled-improve-dep-tests
Improve `dep-tests`
2 parents edddabb + 83e1465 commit 555c549

File tree

4 files changed

+346
-190
lines changed

4 files changed

+346
-190
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -35,56 +35,20 @@ jobs:
3535
uses: actions-rs/cargo@v1
3636
with:
3737
command: fmt
38-
args: --all -- --check
38+
args: -- --check
3939

40-
dep-tests:
41-
strategy:
42-
fail-fast: false
43-
44-
name: dep-tests
45-
runs-on: ubuntu-18.04
46-
47-
steps:
48-
- name: Checkout
49-
uses: actions/checkout@v1
50-
51-
- name: rust-toolchain
52-
uses: actions-rs/toolchain@v1
53-
with:
54-
toolchain: 1.38.0-x86_64-unknown-linux-gnu
55-
override: true
56-
profile: default
57-
58-
- name: '`cargo fmt --all --manifest-path ./dep-tests/Cargo.toml -- --check`'
40+
- name: '`cargo fmt --manifest-path ./dep-tests/Cargo.toml -- --check`'
5941
uses: actions-rs/cargo@v1
6042
with:
6143
command: fmt
62-
args: --all --manifest-path ./dep-tests/Cargo.toml -- --check
63-
64-
- name: '`cargo clippy --manifest-path ./dep-tests/Cargo.toml -- -D warnings`'
65-
uses: actions-rs/cargo@v1
66-
with:
67-
command: clippy
68-
args: --manifest-path ./dep-tests/Cargo.toml -- -D warnings
69-
70-
- name: '`cargo test --no-fail-fast --manifest-path ./dep-tests/Cargo.toml`'
71-
uses: actions-rs/cargo@v1
72-
with:
73-
command: test
74-
args: --no-fail-fast --manifest-path ./dep-tests/Cargo.toml
75-
76-
- name: '`cargo dep-tests --all-features -d 1`'
77-
uses: actions-rs/cargo@v1
78-
with:
79-
command: dep-tests
80-
args: --all-features -d 1
44+
args: --manifest-path ./dep-tests/Cargo.toml -- --check
8145

8246
build:
8347
strategy:
8448
fail-fast: false
8549
matrix:
8650
toolchain:
87-
# `x86_64-pc-windows-msvc` is tier 1 **for now**.
51+
# `x86_64-pc-windows-gnu` is tier 1 **for now**.
8852
- 1.38.0-x86_64-pc-windows-msvc
8953
- 1.38.0-x86_64-pc-windows-gnu
9054
- 1.38.0-x86_64-apple-darwin
@@ -99,28 +63,52 @@ jobs:
9963
- beta-x86_64-unknown-linux-gnu
10064
include:
10165
- toolchain: 1.38.0-x86_64-pc-windows-msvc
66+
features: --no-default-features
67+
dep_tests: true
10268
os: windows-latest
10369
- toolchain: 1.38.0-x86_64-pc-windows-gnu
70+
features: --no-default-features
71+
dep_tests: false
10472
os: windows-latest
10573
- toolchain: 1.38.0-x86_64-apple-darwin
74+
features: --all-features
75+
dep_tests: true
10676
os: macOS-latest
10777
- toolchain: 1.38.0-x86_64-unknown-linux-gnu
78+
features: --all-features
79+
dep_tests: true
10880
os: ubuntu-18.04
10981
- toolchain: stable-x86_64-pc-windows-msvc
82+
features: --no-default-features
83+
dep_tests: true
11084
os: windows-latest
11185
- toolchain: stable-x86_64-pc-windows-gnu
86+
features: --no-default-features
87+
dep_tests: false
11288
os: windows-latest
11389
- toolchain: stable-x86_64-apple-darwin
90+
features: --all-features
91+
dep_tests: true
11492
os: macOS-latest
11593
- toolchain: stable-x86_64-unknown-linux-gnu
94+
features: --all-features
95+
dep_tests: true
11696
os: ubuntu-18.04
11797
- toolchain: beta-x86_64-pc-windows-msvc
98+
features: --no-default-features
99+
dep_tests: true
118100
os: windows-latest
119101
- toolchain: beta-x86_64-pc-windows-gnu
102+
features: --no-default-features
103+
dep_tests: false
120104
os: windows-latest
121105
- toolchain: beta-x86_64-apple-darwin
106+
features: --all-features
107+
dep_tests: true
122108
os: macOS-latest
123109
- toolchain: beta-x86_64-unknown-linux-gnu
110+
features: --all-features
111+
dep_tests: true
124112
os: ubuntu-18.04
125113

126114
name: ${{ matrix.toolchain }}
@@ -141,30 +129,41 @@ jobs:
141129
override: true
142130
profile: default
143131

144-
- name: Determine features
145-
id: features
146-
run: |
147-
if ${{ matrix.os == 'windows-latest' }}; then
148-
echo '::set-output name=features::--no-default-features'
149-
else
150-
echo '::set-output name=features::--all-features'
151-
fi
152-
shell: bash
153-
154-
- name: '`cargo clippy`'
132+
- name: '`cargo clippy ${{ matrix.features }} -- -D warnings`'
155133
uses: actions-rs/cargo@v1
156134
with:
157135
command: clippy
158-
args: ${{ steps.features.outputs.features }} -- -D warnings
136+
args: ${{ matrix.features }} -- -D warnings
159137

160-
- name: '`cargo test`'
138+
- name: '`cargo test ${{ matrix.features }} --no-fail-fast`'
161139
uses: actions-rs/cargo@v1
162140
with:
163141
command: test
164-
args: ${{ steps.features.outputs.features }} --no-fail-fast
142+
args: ${{ matrix.features }} --no-fail-fast
165143

166144
- name: '`cargo run --release`'
167145
uses: actions-rs/cargo@v1
168146
with:
169147
command: run
170-
args: ${{ steps.features.outputs.features }} --release
148+
args: ${{ matrix.features }} --release
149+
150+
- name: '`cargo clippy ${{ matrix.features }} --manifest-path ./dep-tests/Cargo.toml -- -D warnings`'
151+
uses: actions-rs/cargo@v1
152+
with:
153+
command: clippy
154+
args: ${{ matrix.features }} --manifest-path ./dep-tests/Cargo.toml -- -D warnings
155+
if: matrix.dep_tests
156+
157+
- name: '`cargo test ${{ matrix.features }} --manifest-path ./dep-tests/Cargo.toml --no-fail-fast`'
158+
uses: actions-rs/cargo@v1
159+
with:
160+
command: test
161+
args: ${{ matrix.features }} --manifest-path ./dep-tests/Cargo.toml --no-fail-fast
162+
if: matrix.dep_tests
163+
164+
- name: '`cargo dep-tests --all-features -d 1`'
165+
uses: actions-rs/cargo@v1
166+
with:
167+
command: dep-tests
168+
args: --all-features -d 1
169+
if: matrix.dep_tests

dep-tests.toml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
1+
# See `cargo help pkgid`
2+
3+
# **`-p`, `--package`が指定されていないとき**、記述したSPECに対応するpackageを除外する。
14
exclude = [
25
"c2-chacha:0.2.3", # よくわからない理由でビルドに失敗する
36
"derive_more:0.99.2", # 必要なファイルがexcludeされている
4-
"jemallocator:0.3.2", # よくわからない理由でビルドに失敗する
57
"libm:0.1.4", # `#![deny(warnings)]`
68
"mac:0.1.1", # `#![deny(warnings)]`
79
"nom:5.0.1", # 必要なファイルがexcludeされている
810
"num-rational:0.2.2", # よくわからない理由でビルドに失敗する
9-
"petgraph:0.4.13", # よくわからない理由で実行時に失敗する
10-
"primal:0.2.3", # 最終リリース日が古すぎて"normalizing"が行なわれておらず、workspace membersが相対パスのまま
11-
"primal-estimate:0.2.1", # 最終リリース日が古すぎて"normalizing"が行なわれておらず、workspace membersが相対パスのまま
11+
"primal-estimate:0.2.1", # 古すぎて"normalizing"が行なわれておらず、workspace membersが相対パスのまま
12+
"primal:0.2.3", # 古すぎて"normalizing"が行なわれておらず、workspace membersが相対パスのまま
1213
"proc-macro2:1.0.6", # よくわからない理由でビルドに失敗する
14+
"rand:0.6.5", # 現状同一の`name`のpackageは一つのworkspace内で共存できない
1315
"rand_core:0.3.1", # よくわからない理由でビルドに失敗する
14-
# "smallvec:1.0.0", # 成功はするが謎のエラーが表示される
16+
"rand_pcg:0.1.2", # 現状同一の`name`のpackageは一つのworkspace内で共存できない
1517
"syn:0.15.44", # よくわからない理由でビルドに失敗する
1618
"syn:1.0.8", # よくわからない理由でビルドに失敗する
19+
"smallvec:0.6.13", # 現状同一の`name`のpackageは一つのworkspace内で共存できない
1720
]
21+
22+
# key部分でSPECを指定すると、そのSPECの対象のpackageはvalue部分で指定したtargetのみ実行する。
23+
[filter]
24+
"smallvec:1.0.0" = { lib = true } # doc-testでエラーが表示され、成功はするしおそらく実害は無いが見た目がよろしくない
25+
"text_io:0.1.7" = { doc = true, lib = true, test = ["module", "read_str"] } # `"tuple"`が`target/`下の実行ファイルを実行(しかもexamplesの)という行儀の悪いことをやっている

dep-tests/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ publish = false
88

99
[dependencies]
1010
cargo = "0.40.0"
11+
either = "1.5.3"
1112
failure = "0.1.6"
1213
fs_extra = "1.1.0"
1314
itertools = "0.8.2"
@@ -16,3 +17,4 @@ once_cell = "1.2.0"
1617
serde = { version = "1.0.103", features = ["derive"] }
1718
structopt = "0.3.5"
1819
toml = "0.5.5"
20+
toml_edit = "0.1.5"

0 commit comments

Comments
 (0)