-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Giant refactor of everything * Replace slog with fern Due to the changes to how errors are reported and just the general user facing aspect of this tool, it doesn't really make sense to have structured logging for cargo-deny * Update ban check Follows similar reporting to the license check * Remove non-required licenses * Add CHANGELOG * Add 01_allow_license * Add 02_deny_license * Update to spdx 0.2.0 * Add hide-inclusion-graph option * Add help for why a license is accepted * Nuke travis * Replace mergify with github action * Add publish check
- Loading branch information
1 parent
ba8dca8
commit ac7a86e
Showing
32 changed files
with
2,826 additions
and
2,321 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: automerge | ||
on: | ||
pull_request: | ||
types: | ||
- labeled | ||
- unlabeled | ||
- synchronize | ||
- opened | ||
- edited | ||
- ready_for_review | ||
- reopened | ||
- unlocked | ||
pull_request_review: | ||
types: | ||
- submitted | ||
status: {} | ||
jobs: | ||
automerge: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: automerge | ||
uses: "pascalgn/automerge-action@v0.3.2" | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
MERGE_METHOD: "squash" | ||
LABELS: "!work-in-progress" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
on: [push, pull_request] | ||
name: CI | ||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
# make sure all code has been formatted with rustfmt | ||
- run: rustup component add rustfmt | ||
- name: check rustfmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: -- --check --color always | ||
|
||
# run clippy to verify we have no warnings | ||
- run: rustup component add clippy | ||
- name: cargo fetch | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fetch | ||
- name: cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --lib --tests -- -D warnings | ||
|
||
test: | ||
name: Test | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: cargo fetch | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fetch | ||
- name: cargo test build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --tests | ||
- name: cargo test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
|
||
self: | ||
name: Self Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: cargo fetch | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fetch | ||
- name: cargo install | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: install | ||
# Install in debug mode since this part is sloooooow and | ||
# release doesn't really matter much for runtime | ||
args: --path . --debug | ||
- name: self check | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: deny | ||
args: -L debug check | ||
|
||
publish-check: | ||
name: Publish Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: cargo fetch | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fetch | ||
- name: cargo publish | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: publish | ||
args: --dry-run | ||
|
||
publish: | ||
name: Publish | ||
needs: [test, self, publish-check] | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: cargo fetch | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fetch | ||
- name: cargo publish | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} | ||
with: | ||
command: publish | ||
|
||
release: | ||
name: Release | ||
needs: [test, self] | ||
if: startsWith(github.ref, 'refs/tags/') | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
include: | ||
- os: ubuntu-latest | ||
rust: stable | ||
target: x86_64-unknown-linux-musl | ||
bin: cargo-deny | ||
- os: windows-latest | ||
rust: stable | ||
target: x86_64-pc-windows-msvc | ||
bin: cargo-deny.exe | ||
- os: macOS-latest | ||
rust: stable | ||
target: x86_64-apple-darwin | ||
bin: cargo-deny | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
override: true | ||
target: ${{ matrix.target }} | ||
- name: Install musl tools | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get install -y musl-tools | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: cargo fetch | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fetch | ||
args: --target ${{ matrix.target }} | ||
- name: Release build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release --target ${{ matrix.target }} | ||
- name: Package | ||
shell: bash | ||
run: | | ||
name=cargo_deny | ||
tag=$(git describe --tags --abbrev=0) | ||
release_name="$name-$tag-${{ matrix.target }}" | ||
mkdir "$release_name" | ||
if [ "${{ matrix.target }}" != "x86_64-pc-windows-msvc" ]; then | ||
strip "target/${{ matrix.target }}/release/$name" | ||
fi | ||
cp "target/${{ matrix.target }}/release/${{ matrix.bin }}" "$release_name/" | ||
cp README.md LICENSE-APACHE LICENSE-MIT "$release_name/" | ||
tar czvf "$release_name.tar.gz" "$release_name" | ||
rm -r "$release_name" | ||
echo -n "$(shasum -ba 256 "$release_name.tar.gz" | cut -d " " -f 1)" > "$release_name.tar.gz.sha256" | ||
- name: Publish | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
draft: true | ||
files: 'cargo-deny*' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.