@@ -15,21 +15,62 @@ jobs:
15
15
run : rustup update nightly && rustup default nightly && rustup component add rustfmt
16
16
- run : cargo fmt --all -- --check
17
17
clippy :
18
+ name : " clippy #${{ matrix.version }}"
19
+ strategy :
20
+ matrix :
21
+ version : [nightly, "1.56.1"]
18
22
runs-on : ubuntu-latest
19
23
steps :
20
24
- name : Checkout sources
21
25
uses : actions/checkout@v2
22
26
- name : Cache
23
27
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
26
30
- run : cargo clippy --all-targets --all-features -- -D warnings
27
31
licensecheck :
28
32
runs-on : ubuntu-latest
33
+ name : " Presence of licence headers"
29
34
steps :
30
35
- name : Checkout sources
31
36
uses : actions/checkout@v2
32
37
- name : Install licensecheck
33
38
run : sudo apt-get install -y licensecheck
34
39
- 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