forked from l3af-project/l3afd
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (60 loc) · 1.88 KB
/
ci-build.yaml
File metadata and controls
72 lines (60 loc) · 1.88 KB
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
# Copyright Contributors to the L3AF Project.
# SPDX-License-Identifier: Apache-2.0
#
# For documentation on the github environment, see
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
#
# For documentation on the syntax of this file, see
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: CI Ubuntu build
on:
pull_request: {}
push:
branches:
- main
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Setup Go 1.18.6
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: '1.18.6'
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: Set up environment
run : |
sudo apt-get update
sudo apt-get install gcc libc-dev bash perl curl make
- name: Checkout repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- name: Format
run: |
go install golang.org/x/tools/cmd/goimports@latest
res="$(goimports -l .)"
if [[ "$(printf '%s' "$res")" != '' ]]; then
echo "Unformatted source code:"
echo "$res"
exit 1
fi
- name: Vet
run: |
go vet ./...
- name: Test
run: |
go test ./...
- uses: dominikh/staticcheck-action@ba605356b4b29a60e87ab9404b712f3461e566dc
with:
version: "2022.1.1"
install-go: false
- name: Build
run: |
make
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: l3afd-latest-linux-x86_64
path: l3afd