Skip to content

Commit

Permalink
CI tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
samscott89 committed Nov 29, 2020
1 parent cd8704f commit 711debc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ jobs:
- name: Check clippy
uses: actions-rs/clippy-check@v1
with:
args: --all-features --all-targets -- -D warnings
token: 0000000000000000000000000000000000000000
args: --all-targets -- -D warnings

test:
name: Run tests
Expand Down Expand Up @@ -76,27 +77,46 @@ jobs:
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-cargo-test-${{ hashFiles('Cargo.toml') }}
- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Run test
run: cargo test --all-targets --all-features
run: cargo test --all-targets --features long_tests

bench:
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# This prevents the Action from persisting the credentials it uses to
# perform the fetch/checkout to the Runner's local Git config. On
# `pull_request_target` events, the GITHUB_TOKEN provided to the
# Runner has Write permissions to the base repository. We do **not**
# want to allow untrusted code from forks to execute arbitrary Git
# commands with those elevated permissions.
#
# More info:
# https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/#improvements-for-public-repository-forks
persist-credentials: false
# Explicitly setting the `repository` and `ref` inputs ensures that
# `pull_request_target` events trigger CI runs against the code from
# the HEAD branch. By default, this Action checks out code from the
# BASE branch. On `push` events, the `github.event.pull_request` path
# will yield a null value, and passing nulls to these inputs causes
# them to fall back to the defaults
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-bench-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-cargo-bench-${{ hashFiles('Cargo.toml') }}
- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
Expand All @@ -107,24 +127,26 @@ jobs:
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
with:
name: bench_result.txt
name: bench_result
path: output.txt

# Split the benchmark testing step into a separate
# step that runs with no checked-out code and access to secrets
bench-check:
name: Check benchmark result
runs-on: ubuntu-latest
needs: "bench"
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: bench_result.txt
name: bench_result
- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
name: Rust Benchmark
tool: "cargo"
output-file-path: bench_result.txt
output-file-path: output.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
alert-threshold: "150%"
Expand Down
2 changes: 1 addition & 1 deletion src/primitives/argon2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ mod test {
}

#[test] #[cfg(feature = "long_tests")]
fn argon2i_ref_tests() {
fn argon2i_ref_tests_long() {
hashtest(2,
18,
1,
Expand Down

0 comments on commit 711debc

Please sign in to comment.