forked from antrea-io/antrea
-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (64 loc) · 1.8 KB
/
golicense.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Golicense
on:
pull_request:
branches:
- main
- release-*
push:
branches:
- main
- release-*
release:
types:
- created
jobs:
check-changes:
name: Check whether tests need to be run based on diff
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: antrea-io/antrea/ci/gh-actions/has-changes@main
id: check_diff
with:
args: docs/* ci/jenkins/* *.md hack/.notableofcontents
outputs:
has_changes: ${{ steps.check_diff.outputs.has_changes }}
golicense:
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' || github.event_name != 'pull_request' }}
runs-on: [ubuntu-latest]
steps:
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17
- uses: actions/checkout@v2
- name: Cache licensing information for dependencies
uses: actions/cache@v2
id: cache
env:
cache-name: cache-lichen-deps-licensing-info
with:
path: license-reports
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum', 'ci/golicense/**') }}
- run: mkdir antrea-bins
- name: Build assets
run: |
export VERSION="$(head VERSION)"
./hack/release/prepare-assets.sh ./antrea-bins
- name: Build Linux binaries
run: BINDIR=./antrea-bins make bin
- name: Run lichen
if: steps.cache.outputs.cache-hit != 'true'
run: |
mkdir license-reports
./ci/golicense/run.sh ./antrea-bins ./license-reports
- name: Upload licensing information
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: licenses.deps
path: license-reports/ALL.deps.txt
retention-days: 90 # max value