Skip to content

Commit 6dcc2de

Browse files
committed
test
1 parent bd0233b commit 6dcc2de

File tree

4 files changed

+179
-153
lines changed

4 files changed

+179
-153
lines changed

.github/workflows/ci.yml

Lines changed: 157 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ jobs:
3434
matrix:
3535
toolchain:
3636
- stable
37-
- beta
38-
- nightly
39-
- '1.46.0'
37+
# - beta
38+
# - nightly
39+
- '1.48.0'
4040
target:
4141
-
4242
features:
@@ -46,13 +46,15 @@ jobs:
4646
include:
4747
- toolchain: stable
4848
components: clippy
49-
- toolchain: beta
50-
components: clippy
51-
- toolchain: nightly
52-
components: clippy
53-
- toolchain: stable
54-
features: js
55-
target: wasm32-unknown-unknown
49+
# - toolchain: beta
50+
# components: clippy
51+
# - toolchain: nightly
52+
# components: clippy
53+
# - toolchain: stable
54+
# features: js
55+
# target: wasm32-unknown-unknown
56+
- toolchain: '1.48.0'
57+
msrv: true
5658
steps:
5759
- uses: actions/checkout@v2
5860
- name: Install Rust toolchain
@@ -77,7 +79,7 @@ jobs:
7779
tar -xzf "$NAME.tar.gz" "$NAME/wasm-bindgen-test-runner"
7880
mv "$NAME/wasm-bindgen-test-runner" /usr/local/bin/
7981
- run: echo "RUSTFLAGS=$RUSTFLAGS --allow unknown_lints" >> "$GITHUB_ENV"
80-
if: matrix.toolchain == '1.46.0'
82+
if: matrix.msrv
8183
- run: echo 'CARGO_BUILD_TARGET=${{ matrix.target }}' >> "$GITHUB_ENV"
8284
if: matrix.target != ''
8385
- name: Clippy `oauth1-request`
@@ -87,163 +89,165 @@ jobs:
8789
command: clippy
8890
args: --verbose --tests --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
8991
- name: Check docs of `oauth1-request`
90-
if: matrix.features == 'js,derive'
92+
if: ${{ !matrix.msrv && matrix.features == 'js,derive' }}
9193
uses: actions-rs/cargo@v1
9294
with:
9395
command: doc
9496
args: --verbose --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}' --no-deps
9597
- name: Build `oauth1-request`
98+
if: ${{ !matrix.msrv && !contains(matrix.features, 'derive') }}
9699
uses: actions-rs/cargo@v1
97100
with:
98101
command: build
99-
args: --verbose --tests --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
102+
args: --verbose --tests --manifest-path ${{ matrix.msrv && 'oauth1-request-test' || 'oauth1-request' }}/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
100103
- name: Build `examples`
101-
if: ${{ matrix.target == '' && matrix.toolchain != '1.46.0' }}
104+
if: ${{ !matrix.msrv && matrix.target == '' }}
102105
uses: actions-rs/cargo@v1
103106
with:
104107
command: build
105108
args: --verbose --manifest-path examples/Cargo.toml
106109
- name: Test `oauth1-request`
110+
if: ${{ !matrix.msrv && matrix.target == '' }}
107111
uses: actions-rs/cargo@v1
108112
with:
109113
command: test
110114
args: --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
111-
derive-test:
112-
name: Test `oauth1-request-derive`
113-
runs-on: ubuntu-latest
114-
strategy:
115-
fail-fast: false
116-
matrix:
117-
toolchain:
118-
- stable
119-
- beta
120-
- nightly
121-
# UI test results changes frequently and sometimes there may not be any way to
122-
# make the test pass for all toolchains at the same time.
123-
# Also, we don't want the workflow to break nightly :)
124-
continue-on-error: ${{ matrix.toolchain != 'stable' }}
125-
steps:
126-
- uses: actions/checkout@v2
127-
- name: Install Rust toolchain
128-
uses: actions-rs/toolchain@v1
129-
with:
130-
toolchain: ${{ matrix.toolchain }}
131-
profile: minimal
132-
override: true
133-
- uses: Swatinem/rust-cache@v1
134-
- name: Build `oauth1-request-derive`
135-
uses: actions-rs/cargo@v1
136-
with:
137-
command: build
138-
args: --verbose --tests --manifest-path oauth1-request-derive/Cargo.toml
139-
- name: Test `oauth1-request-derive`
140-
uses: actions-rs/cargo@v1
141-
with:
142-
command: test
143-
args: --verbose --manifest-path oauth1-request-derive/Cargo.toml
144-
credentials-msrv:
145-
name: Build `oauth-credentials` on MSRV
146-
runs-on: ubuntu-latest
147-
strategy:
148-
matrix:
149-
toolchain:
150-
- '1.0.0'
151-
- '1.6.0'
152-
- '1.36.0'
153-
include:
154-
- toolchain: '1.0.0'
155-
features: std
156-
- toolchain: '1.6.0'
157-
- toolchain: '1.36.0'
158-
features: alloc
159-
steps:
160-
- uses: actions/checkout@v2
161-
- name: Install Rust toolchain
162-
uses: actions-rs/toolchain@v1
163-
with:
164-
toolchain: ${{ matrix.toolchain }}
165-
profile: minimal
166-
override: true
167-
- uses: Swatinem/rust-cache@v1
168-
- uses: actions/checkout@v2
169-
with:
170-
repository: rust-lang/crates.io-index
171-
ref: 46a429eac9f70fd7281922780d7dd42e2fb7ab77
172-
path: crates.io-index
173-
- name: Workaround compatibility issues of Cargo
174-
run: |
175-
# Remove the virtual manifest because Rust 1.13.0 run fails when built as a workspace member.
176-
rm Cargo.toml
177-
# Reference: <https://github.com/mcgoo/vcpkg-rs/blob/f75707b/.github/workflows/rust-1.12.yml>
178-
mkdir -p oauth-credentials/.cargo
179-
cat <<EOF >> oauth-credentials/.cargo/config
180-
[source.crates-io]
181-
registry = "file://$GITHUB_WORKSPACE/crates.io-index"
182-
EOF
183-
- name: Build `oauth-credentials`
184-
uses: actions-rs/cargo@v1
185-
with:
186-
command: build
187-
# Toolchains older than 1.8.0 cannot compile `oauth-credentials` directly
188-
# because the toolchains do not understand Cargo registry's information for `serde`
189-
# (see <https://github.com/rust-lang/cargo/issues/3763>).
190-
# So, with these toolchains, we instead build a dependant crate of `oauth-credentials`
191-
# without `serde` feature.
192-
args: --verbose --manifest-path oauth-credentials-test/Cargo.toml --no-default-features --features=${{ matrix.features }}
193-
credentials-test:
194-
name: Test `oauth-credentials`
195-
runs-on: ubuntu-latest
196-
env:
197-
RUSTFLAGS: --allow unknown_lints
198-
strategy:
199-
fail-fast: false
200-
matrix:
201-
toolchain:
202-
- stable
203-
- beta
204-
- nightly
205-
features:
206-
- serde
207-
- std
208-
steps:
209-
- uses: actions/checkout@v2
210-
- name: Install Rust toolchain
211-
uses: actions-rs/toolchain@v1
212-
with:
213-
toolchain: ${{ matrix.toolchain }}
214-
profile: minimal
215-
override: true
216-
- uses: Swatinem/rust-cache@v1
217-
- name: Build `oauth-credentials`
218-
uses: actions-rs/cargo@v1
219-
with:
220-
command: build
221-
args: --verbose --manifest-path oauth-credentials/Cargo.toml --features=${{ matrix.features }}
222-
- name: Test `oauth-credentials`
223-
uses: actions-rs/cargo@v1
224-
with:
225-
command: test
226-
args: --verbose --manifest-path oauth-credentials/Cargo.toml --features=${{ matrix.features }}
227-
min-deps:
228-
name: Check with `-Z minimal-versions`
229-
runs-on: ubuntu-latest
230-
steps:
231-
- uses: actions/checkout@v2
232-
- name: Install Rust toolchain
233-
uses: actions-rs/toolchain@v1
234-
with:
235-
toolchain: stable
236-
profile: minimal
237-
- uses: Swatinem/rust-cache@v1
238-
- name: Cargo update
239-
uses: actions-rs/cargo@v1
240-
with:
241-
command: update
242-
args: -Z minimal-versions
243-
env:
244-
RUSTC_BOOTSTRAP: 1
245-
- name: Check
246-
uses: actions-rs/cargo@v1
247-
with:
248-
command: check
249-
args: --verbose --all-features
115+
# derive-test:
116+
# name: Test `oauth1-request-derive`
117+
# runs-on: ubuntu-latest
118+
# strategy:
119+
# fail-fast: false
120+
# matrix:
121+
# toolchain:
122+
# - stable
123+
# - beta
124+
# - nightly
125+
# # UI test results changes frequently and sometimes there may not be any way to
126+
# # make the test pass for all toolchains at the same time.
127+
# # Also, we don't want the workflow to break nightly :)
128+
# continue-on-error: ${{ matrix.toolchain != 'stable' }}
129+
# steps:
130+
# - uses: actions/checkout@v2
131+
# - name: Install Rust toolchain
132+
# uses: actions-rs/toolchain@v1
133+
# with:
134+
# toolchain: ${{ matrix.toolchain }}
135+
# profile: minimal
136+
# override: true
137+
# - uses: Swatinem/rust-cache@v1
138+
# - name: Build `oauth1-request-derive`
139+
# uses: actions-rs/cargo@v1
140+
# with:
141+
# command: build
142+
# args: --verbose --tests --manifest-path oauth1-request-derive/Cargo.toml
143+
# - name: Test `oauth1-request-derive`
144+
# uses: actions-rs/cargo@v1
145+
# with:
146+
# command: test
147+
# args: --verbose --manifest-path oauth1-request-derive/Cargo.toml
148+
# credentials-msrv:
149+
# name: Build `oauth-credentials` on MSRV
150+
# runs-on: ubuntu-latest
151+
# strategy:
152+
# matrix:
153+
# toolchain:
154+
# - '1.0.0'
155+
# - '1.6.0'
156+
# - '1.36.0'
157+
# include:
158+
# - toolchain: '1.0.0'
159+
# features: std
160+
# - toolchain: '1.6.0'
161+
# - toolchain: '1.36.0'
162+
# features: alloc
163+
# steps:
164+
# - uses: actions/checkout@v2
165+
# - name: Install Rust toolchain
166+
# uses: actions-rs/toolchain@v1
167+
# with:
168+
# toolchain: ${{ matrix.toolchain }}
169+
# profile: minimal
170+
# override: true
171+
# - uses: Swatinem/rust-cache@v1
172+
# - uses: actions/checkout@v2
173+
# with:
174+
# repository: rust-lang/crates.io-index
175+
# ref: 46a429eac9f70fd7281922780d7dd42e2fb7ab77
176+
# path: crates.io-index
177+
# - name: Workaround compatibility issues of Cargo
178+
# run: |
179+
# # Remove the virtual manifest because Rust 1.13.0 run fails when built as a workspace member.
180+
# rm Cargo.toml
181+
# # Reference: <https://github.com/mcgoo/vcpkg-rs/blob/f75707b/.github/workflows/rust-1.12.yml>
182+
# mkdir -p oauth-credentials/.cargo
183+
# cat <<EOF >> oauth-credentials/.cargo/config
184+
# [source.crates-io]
185+
# registry = "file://$GITHUB_WORKSPACE/crates.io-index"
186+
# EOF
187+
# - name: Build `oauth-credentials`
188+
# uses: actions-rs/cargo@v1
189+
# with:
190+
# command: build
191+
# # Toolchains older than 1.8.0 cannot compile `oauth-credentials` directly
192+
# # because the toolchains do not understand Cargo registry's information for `serde`
193+
# # (see <https://github.com/rust-lang/cargo/issues/3763>).
194+
# # So, with these toolchains, we instead build a dependant crate of `oauth-credentials`
195+
# # without `serde` feature.
196+
# args: --verbose --manifest-path oauth-credentials-test/Cargo.toml --no-default-features --features=${{ matrix.features }}
197+
# credentials-test:
198+
# name: Test `oauth-credentials`
199+
# runs-on: ubuntu-latest
200+
# env:
201+
# RUSTFLAGS: --allow unknown_lints
202+
# strategy:
203+
# fail-fast: false
204+
# matrix:
205+
# toolchain:
206+
# - stable
207+
# - beta
208+
# - nightly
209+
# features:
210+
# - serde
211+
# - std
212+
# steps:
213+
# - uses: actions/checkout@v2
214+
# - name: Install Rust toolchain
215+
# uses: actions-rs/toolchain@v1
216+
# with:
217+
# toolchain: ${{ matrix.toolchain }}
218+
# profile: minimal
219+
# override: true
220+
# - uses: Swatinem/rust-cache@v1
221+
# - name: Build `oauth-credentials`
222+
# uses: actions-rs/cargo@v1
223+
# with:
224+
# command: build
225+
# args: --verbose --manifest-path oauth-credentials/Cargo.toml --features=${{ matrix.features }}
226+
# - name: Test `oauth-credentials`
227+
# uses: actions-rs/cargo@v1
228+
# with:
229+
# command: test
230+
# args: --verbose --manifest-path oauth-credentials/Cargo.toml --features=${{ matrix.features }}
231+
# min-deps:
232+
# name: Check with `-Z minimal-versions`
233+
# runs-on: ubuntu-latest
234+
# steps:
235+
# - uses: actions/checkout@v2
236+
# - name: Install Rust toolchain
237+
# uses: actions-rs/toolchain@v1
238+
# with:
239+
# toolchain: stable
240+
# profile: minimal
241+
# - uses: Swatinem/rust-cache@v1
242+
# - name: Cargo update
243+
# uses: actions-rs/cargo@v1
244+
# with:
245+
# command: update
246+
# args: -Z minimal-versions
247+
# env:
248+
# RUSTC_BOOTSTRAP: 1
249+
# - name: Check
250+
# uses: actions-rs/cargo@v1
251+
# with:
252+
# command: check
253+
# args: --verbose --all-features

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ members = [
33
"oauth-credentials",
44
"oauth1-request",
55
"oauth1-request-derive",
6+
"oauth1-request-test",
67
]
78

89
[patch.crates-io]

oauth1-request-test/Cargo.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[package]
2+
name = "oauth1-request-test"
3+
version = "0.0.0"
4+
edition = "2018"
5+
authors = ["Daiki Mizukami <[email protected]>"]
6+
description = "A hack to make the CI work with older toolchains."
7+
publish = false
8+
9+
[dependencies]
10+
oauth1-request = { path = "../oauth1-request", default-features = false }
11+
12+
[features]
13+
default = ["hmac-sha1", "std"]
14+
alloc = ["oauth1-request/alloc"]
15+
hmac-sha1 = ["oauth1-request/hmac-sha1"]
16+
rsa-sha1-06 = ["oauth1-request/rsa-sha1-06"]
17+
js = ["oauth1-request/js"]
18+
serde = ["oauth1-request/serde"]
19+
std = ["oauth1-request/std"]
20+
test = ["oauth1-request/test"]

oauth1-request-test/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub use oauth1_request::*;

0 commit comments

Comments
 (0)