Skip to content

Commit eb5b0e8

Browse files
pawelchckipaullegranddc
authored andcommitted
Add more lints to correspond with existing build system (#58)
* Update 3rd party license file * Allow mutex_atomic clippy lint rust-lang/rust-clippy#4295 * add more lints to correspond with existing build system * Remove empty trailing lines * Fix cargo home directory in LICENSE-3rdparty file * Export new license file on check fail Co-authored-by: paullegranddc <[email protected]> Co-authored-by: paullegranddc <[email protected]>
1 parent 7cb9f7e commit eb5b0e8

File tree

1 file changed

+44
-3
lines changed

1 file changed

+44
-3
lines changed

.github/workflows/lint.yml

+44-3
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,62 @@ jobs:
1515
run: rustup update nightly && rustup default nightly && rustup component add rustfmt
1616
- run: cargo fmt --all -- --check
1717
clippy:
18+
name: "clippy #${{ matrix.version }}"
19+
strategy:
20+
matrix:
21+
version: [nightly, "1.56.1"]
1822
runs-on: ubuntu-latest
1923
steps:
2024
- name: Checkout sources
2125
uses: actions/checkout@v2
2226
- name: Cache
2327
uses: ./.github/actions/cache
24-
- name: Install latest nightly toolchain and clippy
25-
run: rustup update nightly && rustup default nightly && rustup component add clippy
28+
- name: Install ${{ matrix.version }} toolchain and clippy
29+
run: rustup install ${{ matrix.version }} && rustup default ${{ matrix.version }} && rustup component add clippy
2630
- run: cargo clippy --all-targets --all-features -- -D warnings
2731
licensecheck:
2832
runs-on: ubuntu-latest
33+
name: "Presence of licence headers"
2934
steps:
3035
- name: Checkout sources
3136
uses: actions/checkout@v2
3237
- name: Install licensecheck
3338
run: sudo apt-get install -y licensecheck
3439
- name: Check licenses
35-
run: '! find . -name "*.rs" -o -name "*.c" -o -name "*.sh" | xargs licensecheck -c ".*" | grep -v "Apache License 2.0"'
40+
run: '! find . -name "*.rs" -o -name "*.c" -o -name "*.sh" | xargs licensecheck -c ".*" | grep -v "Apache License 2.0"'
41+
42+
# todo: fix upstream warnings; from the readme:
43+
# The most common cause of missing licenses seems to be workspaces that
44+
# don't include forward their license files. Go to the repo for the
45+
# workspace and copy the relevant files from there.
46+
# A package license may receive a confidence warning stating that
47+
# cargo-bundle-licenses is "unsure" or "semi" confident. This means that
48+
# when the found license was compared to a template license it was found to
49+
# have diverged in more than a few words. You should verify that the licence
50+
# text is in fact correct in these cases.
51+
#
52+
# If this job fails, you need to regenerate the license, e.g.
53+
# CARGO_HOME=/tmp/dd-cargo cargo bundle-licenses --format yaml --output LICENSE-3rdparty.yml
54+
license-3rdparty:
55+
runs-on: ubuntu-latest
56+
name: "Valid LICENSE-3rdparty.yml"
57+
steps:
58+
- name: Checkout sources
59+
uses: actions/checkout@v2
60+
- run: stat LICENSE-3rdparty.yml
61+
- run: cargo install cargo-bundle-licenses
62+
- name: "Generate new LICENSE-3rdparty.yml and check against the previous"
63+
env:
64+
CARGO_HOME: "/tmp/dd-cargo"
65+
run: >
66+
cargo bundle-licenses \
67+
--format yaml \
68+
--output /tmp/CI.yaml \
69+
--previous LICENSE-3rdparty.yml \
70+
--check-previous
71+
- name: export the generated license file on failure
72+
if: ${{ failure() }}
73+
uses: actions/upload-artifact@v1
74+
with:
75+
name: LICENSE-3rdparty.yml
76+
path: /tmp/CI.yaml

0 commit comments

Comments
 (0)