Skip to content

Improve dep-tests #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 54 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,56 +35,20 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
args: -- --check

dep-tests:
strategy:
fail-fast: false

name: dep-tests
runs-on: ubuntu-18.04

steps:
- name: Checkout
uses: actions/checkout@v1

- name: rust-toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.38.0-x86_64-unknown-linux-gnu
override: true
profile: default

- name: '`cargo fmt --all --manifest-path ./dep-tests/Cargo.toml -- --check`'
- name: '`cargo fmt --manifest-path ./dep-tests/Cargo.toml -- --check`'
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --manifest-path ./dep-tests/Cargo.toml -- --check

- name: '`cargo clippy --manifest-path ./dep-tests/Cargo.toml -- -D warnings`'
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path ./dep-tests/Cargo.toml -- -D warnings

- name: '`cargo test --no-fail-fast --manifest-path ./dep-tests/Cargo.toml`'
uses: actions-rs/cargo@v1
with:
command: test
args: --no-fail-fast --manifest-path ./dep-tests/Cargo.toml

- name: '`cargo dep-tests --all-features -d 1`'
uses: actions-rs/cargo@v1
with:
command: dep-tests
args: --all-features -d 1
args: --manifest-path ./dep-tests/Cargo.toml -- --check

build:
strategy:
fail-fast: false
matrix:
toolchain:
# `x86_64-pc-windows-msvc` is tier 1 **for now**.
# `x86_64-pc-windows-gnu` is tier 1 **for now**.
- 1.38.0-x86_64-pc-windows-msvc
- 1.38.0-x86_64-pc-windows-gnu
- 1.38.0-x86_64-apple-darwin
Expand All @@ -99,28 +63,52 @@ jobs:
- beta-x86_64-unknown-linux-gnu
include:
- toolchain: 1.38.0-x86_64-pc-windows-msvc
features: --no-default-features
dep_tests: true
os: windows-latest
- toolchain: 1.38.0-x86_64-pc-windows-gnu
features: --no-default-features
dep_tests: false
os: windows-latest
- toolchain: 1.38.0-x86_64-apple-darwin
features: --all-features
dep_tests: true
os: macOS-latest
- toolchain: 1.38.0-x86_64-unknown-linux-gnu
features: --all-features
dep_tests: true
os: ubuntu-18.04
- toolchain: stable-x86_64-pc-windows-msvc
features: --no-default-features
dep_tests: true
os: windows-latest
- toolchain: stable-x86_64-pc-windows-gnu
features: --no-default-features
dep_tests: false
os: windows-latest
- toolchain: stable-x86_64-apple-darwin
features: --all-features
dep_tests: true
os: macOS-latest
- toolchain: stable-x86_64-unknown-linux-gnu
features: --all-features
dep_tests: true
os: ubuntu-18.04
- toolchain: beta-x86_64-pc-windows-msvc
features: --no-default-features
dep_tests: true
os: windows-latest
- toolchain: beta-x86_64-pc-windows-gnu
features: --no-default-features
dep_tests: false
os: windows-latest
- toolchain: beta-x86_64-apple-darwin
features: --all-features
dep_tests: true
os: macOS-latest
- toolchain: beta-x86_64-unknown-linux-gnu
features: --all-features
dep_tests: true
os: ubuntu-18.04

name: ${{ matrix.toolchain }}
Expand All @@ -141,30 +129,41 @@ jobs:
override: true
profile: default

- name: Determine features
id: features
run: |
if ${{ matrix.os == 'windows-latest' }}; then
echo '::set-output name=features::--no-default-features'
else
echo '::set-output name=features::--all-features'
fi
shell: bash

- name: '`cargo clippy`'
- name: '`cargo clippy ${{ matrix.features }} -- -D warnings`'
uses: actions-rs/cargo@v1
with:
command: clippy
args: ${{ steps.features.outputs.features }} -- -D warnings
args: ${{ matrix.features }} -- -D warnings

- name: '`cargo test`'
- name: '`cargo test ${{ matrix.features }} --no-fail-fast`'
uses: actions-rs/cargo@v1
with:
command: test
args: ${{ steps.features.outputs.features }} --no-fail-fast
args: ${{ matrix.features }} --no-fail-fast

- name: '`cargo run --release`'
uses: actions-rs/cargo@v1
with:
command: run
args: ${{ steps.features.outputs.features }} --release
args: ${{ matrix.features }} --release

- name: '`cargo clippy ${{ matrix.features }} --manifest-path ./dep-tests/Cargo.toml -- -D warnings`'
uses: actions-rs/cargo@v1
with:
command: clippy
args: ${{ matrix.features }} --manifest-path ./dep-tests/Cargo.toml -- -D warnings
if: matrix.dep_tests

- name: '`cargo test ${{ matrix.features }} --manifest-path ./dep-tests/Cargo.toml --no-fail-fast`'
uses: actions-rs/cargo@v1
with:
command: test
args: ${{ matrix.features }} --manifest-path ./dep-tests/Cargo.toml --no-fail-fast
if: matrix.dep_tests

- name: '`cargo dep-tests --all-features -d 1`'
uses: actions-rs/cargo@v1
with:
command: dep-tests
args: --all-features -d 1
if: matrix.dep_tests
18 changes: 13 additions & 5 deletions dep-tests.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
# See `cargo help pkgid`

# **`-p`, `--package`が指定されていないとき**、記述したSPECに対応するpackageを除外する。
exclude = [
"c2-chacha:0.2.3", # よくわからない理由でビルドに失敗する
"derive_more:0.99.2", # 必要なファイルがexcludeされている
"jemallocator:0.3.2", # よくわからない理由でビルドに失敗する
"libm:0.1.4", # `#![deny(warnings)]`
"mac:0.1.1", # `#![deny(warnings)]`
"nom:5.0.1", # 必要なファイルがexcludeされている
"num-rational:0.2.2", # よくわからない理由でビルドに失敗する
"petgraph:0.4.13", # よくわからない理由で実行時に失敗する
"primal:0.2.3", # 最終リリース日が古すぎて"normalizing"が行なわれておらず、workspace membersが相対パスのまま
"primal-estimate:0.2.1", # 最終リリース日が古すぎて"normalizing"が行なわれておらず、workspace membersが相対パスのまま
"primal-estimate:0.2.1", # 古すぎて"normalizing"が行なわれておらず、workspace membersが相対パスのまま
"primal:0.2.3", # 古すぎて"normalizing"が行なわれておらず、workspace membersが相対パスのまま
"proc-macro2:1.0.6", # よくわからない理由でビルドに失敗する
"rand:0.6.5", # 現状同一の`name`のpackageは一つのworkspace内で共存できない
"rand_core:0.3.1", # よくわからない理由でビルドに失敗する
# "smallvec:1.0.0", # 成功はするが謎のエラーが表示される
"rand_pcg:0.1.2", # 現状同一の`name`のpackageは一つのworkspace内で共存できない
"syn:0.15.44", # よくわからない理由でビルドに失敗する
"syn:1.0.8", # よくわからない理由でビルドに失敗する
"smallvec:0.6.13", # 現状同一の`name`のpackageは一つのworkspace内で共存できない
]

# key部分でSPECを指定すると、そのSPECの対象のpackageはvalue部分で指定したtargetのみ実行する。
[filter]
"smallvec:1.0.0" = { lib = true } # doc-testでエラーが表示され、成功はするしおそらく実害は無いが見た目がよろしくない
"text_io:0.1.7" = { doc = true, lib = true, test = ["module", "read_str"] } # `"tuple"`が`target/`下の実行ファイルを実行(しかもexamplesの)という行儀の悪いことをやっている
2 changes: 2 additions & 0 deletions dep-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ publish = false

[dependencies]
cargo = "0.40.0"
either = "1.5.3"
failure = "0.1.6"
fs_extra = "1.1.0"
itertools = "0.8.2"
Expand All @@ -16,3 +17,4 @@ once_cell = "1.2.0"
serde = { version = "1.0.103", features = ["derive"] }
structopt = "0.3.5"
toml = "0.5.5"
toml_edit = "0.1.5"
Loading