Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
tesaguri committed Jun 19, 2024
1 parent bd0233b commit 1730cd3
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 19 deletions.
47 changes: 28 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,31 @@ jobs:
fail-fast: false
matrix:
toolchain:
- stable
- beta
- nightly
- '1.46.0'
# - stable
# - beta
# - nightly
- '1.48.0'
target:
-
features:
- js
- js,derive
- js,hmac-sha1
include:
- toolchain: stable
components: clippy
- toolchain: beta
components: clippy
- toolchain: nightly
components: clippy
- toolchain: stable
features: js
target: wasm32-unknown-unknown
- crate_name: oauth1-request
# - toolchain: stable
# components: clippy
# - toolchain: beta
# components: clippy
# - toolchain: nightly
# components: clippy
# - toolchain: stable
# features: js
# crate_name: oauth1-request
# target: wasm32-unknown-unknown
- toolchain: '1.48.0'
crate_name: oauth1-request-test
msrv: true
steps:
- uses: actions/checkout@v2
- name: Install Rust toolchain
Expand All @@ -77,37 +82,41 @@ jobs:
tar -xzf "$NAME.tar.gz" "$NAME/wasm-bindgen-test-runner"
mv "$NAME/wasm-bindgen-test-runner" /usr/local/bin/
- run: echo "RUSTFLAGS=$RUSTFLAGS --allow unknown_lints" >> "$GITHUB_ENV"
if: matrix.toolchain == '1.46.0'
if: matrix.msrv
- run: echo 'CARGO_BUILD_TARGET=${{ matrix.target }}' >> "$GITHUB_ENV"
if: matrix.target != ''
- run: rm Cargo.toml
if: matrix.crate_name == 'oauth1-request-test'
- name: Clippy `oauth1-request`
if: contains(matrix.components, 'clippy')
uses: actions-rs/cargo@v1
with:
command: clippy
args: --verbose --tests --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
args: --verbose --tests --manifest-path ${{ matrix.crate_name }}/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
- name: Check docs of `oauth1-request`
if: matrix.features == 'js,derive'
uses: actions-rs/cargo@v1
with:
command: doc
args: --verbose --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}' --no-deps
args: --verbose --manifest-path ${{ matrix.crate_name }}/Cargo.toml --no-default-features '--features=${{ matrix.features }}' --no-deps
- name: Build `oauth1-request`
if: matrix.crate_name != 'oauth1-request-test' || !contains(matrix.features, 'derive')
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --tests --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
args: --verbose --tests --manifest-path ${{ matrix.crate_name }}/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
- name: Build `examples`
if: ${{ matrix.target == '' && matrix.toolchain != '1.46.0' }}
if: ${{ matrix.target == '' && !matrix.msrv }}
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --manifest-path examples/Cargo.toml
- name: Test `oauth1-request`
if: ${{ matrix.target == '' && !matrix.msrv }}
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path oauth1-request/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
args: --manifest-path ${{ matrix.crate_name }}/Cargo.toml --no-default-features '--features=${{ matrix.features }}'
derive-test:
name: Test `oauth1-request-derive`
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ members = [
"oauth-credentials",
"oauth1-request",
"oauth1-request-derive",
"oauth1-request-test",
]

[patch.crates-io]
Expand Down
20 changes: 20 additions & 0 deletions oauth1-request-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "oauth1-request-test"
version = "0.0.0"
edition = "2018"
authors = ["Daiki Mizukami <[email protected]>"]
description = "A hack to make the CI work with older toolchains."
publish = false

[dependencies]
oauth1-request = { path = "../oauth1-request", default-features = false }

[features]
default = ["hmac-sha1", "std"]
alloc = ["oauth1-request/alloc"]
hmac-sha1 = ["oauth1-request/hmac-sha1"]
rsa-sha1-06 = ["oauth1-request/rsa-sha1-06"]
js = ["oauth1-request/js"]
serde = ["oauth1-request/serde"]
std = ["oauth1-request/std"]
test = ["oauth1-request/test"]
1 change: 1 addition & 0 deletions oauth1-request-test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub use oauth1_request::*;

0 comments on commit 1730cd3

Please sign in to comment.