-
Notifications
You must be signed in to change notification settings - Fork 108
171 lines (134 loc) · 3.87 KB
/
main.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# SPDX-License-Identifier: Apache-2.0
# Copyright 2023 Canonical Ltd.
# Copyright 2024 Intel Corporation
name: Main workflow
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Generate protobuf
run: make pb
- name: Build the BESS-UPF Docker image
run: DOCKER_TARGETS=bess make docker-build
- name: Build the PFCP Agent Docker image
run: DOCKER_TARGETS=pfcpiface make docker-build
build-ptf:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./ptf
steps:
- uses: actions/checkout@v4
- name: Build PTF image
run: make build
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/[email protected]
with:
version: latest
args: -v --config ./.golangci.yml
hadolint:
name: hadolint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Dockerfile linter
uses: hadolint/[email protected]
# For now, ignoring:
# DL3007 warning: Pin the version explicitily to a release tag (no latest);
# DL3008 warning: Pin versions in apt get install (e.g., apt-get install <package>=<version>); and
# DL3018 warning: Pin versions in apk add (e.g., apk add <package>=<version>)
with:
dockerfile: Dockerfile
ignore: DL3007,DL3008,DL3018
check-spelling:
name: Markdown spellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check Spelling
uses: rojopolis/[email protected]
with:
config_path: .spellcheck.yml
task_name: Markdown
route-control-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Create virtual environment
run: python -m venv venv
- name: Install dependencies
run: |
source ./venv/bin/activate
pip install -r requirements.txt
- name: Run tests
run: |
source ./venv/bin/activate
python -m unittest ./conf/test_route_control.py
- name: Clean up virtual environment
run: rm -rf venv
unit-tests-pfcp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Run unit tests for PFCP Agent
run: make test
integration-tests-up4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Run integration tests for PFCP Agent & UP4
run: make test-up4-integration-docker || (docker logs pfcpiface; exit 1)
integration-tests-bess:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Run integration tests for PFCP Agent & UP4
run: make test-bess-integration-native
license-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: reuse lint
uses: fsfe/reuse-action@v4
fossa-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: FOSSA scan
uses: fossa-contrib/fossa-action@v3
with:
fossa-api-key: 0c3bbcdf20e157bbd487dae173751b28