Skip to content

Commit

Permalink
Upgrade cargo-deny 0.6.8 -> 0.7.3 (#21)
Browse files Browse the repository at this point in the history
* Upgrade cargo-deny 0.6.8 -> 0.7.3

Bump the Cargo deny version to 0.7.3.

Update the tests to use --manifest path instead of the now removed
--context option.

* Add optional input arguments, default --all-features

Add a new optional input to the action named arguments, that can be
used to pass a custom set of arguments to cargo-deny.

The default for arguments is to pass in --all-features, which for
cargo-deny 0.7 runs the same behaviour as cargo-deny 0.6 did.

Updated README to reflect the changes.

Co-authored-by: Jake Shadle <jake.shadle@embark-studios.com>
  • Loading branch information
zayenz and Jake-Shadle authored Aug 26, 2020
1 parent 5cd00fa commit 3187ba4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
run: docker build -t test-cargo-deny .

- name: Run list
run: docker run -v ${PWD}/test:/test test-cargo-deny --context test list
run: docker run -v ${PWD}/test:/test test-cargo-deny --manifest-path test/Cargo.toml list

- name: Run check
run: docker run -v ${PWD}/test:/test test-cargo-deny --context test check
run: docker run -v ${PWD}/test:/test test-cargo-deny --manifest-path test/Cargo.toml check
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM rust:alpine

RUN apk add --no-cache curl

RUN curl --silent -L --output cargo-deny.tar.gz https://github.com/EmbarkStudios/cargo-deny/releases/download/0.6.8/cargo-deny-0.6.8-x86_64-unknown-linux-musl.tar.gz
RUN curl --silent -L --output cargo-deny.tar.gz https://github.com/EmbarkStudios/cargo-deny/releases/download/0.7.3/cargo-deny-0.7.3-x86_64-unknown-linux-musl.tar.gz
RUN tar -xzvf cargo-deny.tar.gz -C . --strip-components=1

COPY entrypoint.sh /entrypoint.sh
Expand Down
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ GitHub Action for running [`cargo-deny`](https://github.com/EmbarkStudios/cargo-
Create a `deny.toml` file in the root of the repo to use as rules for the action ([example](https://github.com/EmbarkStudios/cargo-deny/blob/master/deny.toml)).
See [`cargo-deny`](https://github.com/EmbarkStudios/cargo-deny) for instructions and details of the format and capabilities.

This action will run `cargo-deny check` and report failure if any banned crates or disallowed open souce licenses are found used in the crate or its dependencies.
This action will run `cargo-deny check` and report failure if any banned crates or disallowed open source licenses are found used in the crate or its dependencies.

The action has three optional inputs

* `log-level`: The log level to use for `cargo-deny`, default is `warn`
* `command`: The command to use for `cargo-deny`, default is `check`
* `arguments`: The argument to pass to `cargo-deny`, default is `--all-features`. See [Common Options](https://embarkstudios.github.io/cargo-deny/cli/common.html) for a list of the available options.

### Example pipeline

Expand All @@ -26,6 +32,23 @@ jobs:
- uses: EmbarkStudios/cargo-deny-action@v1
```
### Example pipeline with custom options using default values
```yaml
name: CI
on: [push, pull_request]
jobs:
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: EmbarkStudios/cargo-deny-action@v1
with:
log-level: warn
command: check
arguments: --all-features
```
## Users
Repositories using this action (PR to add your repo):
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
description: "The command to run with cargo-deny"
required: false
default: "check"
arguments:
description: "The arguments to pass to cargo-deny"
required: false
default: "--all-features"
log-level:
description: "The log level for cargo-deny"
required: false
Expand All @@ -22,4 +26,5 @@ runs:
args:
- --log-level
- ${{ inputs.log-level }}
- ${{ inputs.arguments }}
- ${{ inputs.command }}

0 comments on commit 3187ba4

Please sign in to comment.