generated from networkservicemesh/cmd-template
-
Notifications
You must be signed in to change notification settings - Fork 11
81 lines (72 loc) · 2.32 KB
/
ci.yaml
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
---
name: ci
on:
push:
branches:
- 'main'
- 'release/**'
pull_request:
jobs:
yamllint:
uses: networkservicemesh/.github/.github/workflows/yamllint.yaml@main
with:
config_file: "./.yamllint.yml"
shellcheck:
uses: networkservicemesh/.github/.github/workflows/shellcheck.yaml@main
build:
name: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.23.3
- name: Build
run: go build -race ./...
golangci-lint:
uses: networkservicemesh/.github/.github/workflows/golangci-lint.yaml@main
excludeFmtErrorf:
uses: networkservicemesh/.github/.github/workflows/exclude-fmt-errorf.yaml@main
restrictNSMDeps:
uses: networkservicemesh/.github/.github/workflows/restrict-nsm-deps.yaml@main
with:
allowed_repositories: "api, sdk, sdk-k8s, sdk-ovs, sdk-sriov, sdk-kernel"
checkgomod:
uses: networkservicemesh/.github/.github/workflows/checkgomod.yaml@main
gogenerate:
uses: networkservicemesh/.github/.github/workflows/cmd-gogenerate.yaml@main
excludereplace:
uses: networkservicemesh/.github/.github/workflows/exclude-replace.yaml@main
docker:
name: Docker Build & Test
runs-on: ubuntu-latest
if: github.repository != 'networkservicemesh/cmd-template'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v5
with:
go-version: 1.23.3
- name: Build container
run: docker build .
- name: Run tests
run: docker run --privileged --rm $(docker build -q . --target test)
- name: Find merged PR
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: jwalton/gh-find-current-pr@v1
id: findPr
with:
github-token: ${{ github.token }}
- name: Publish Image
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && success() && steps.findPr.outputs.number
uses: matootie/[email protected]
with:
accessToken: ${{ github.token }}
tag: |
pr-${{ steps.findPr.outputs.pr }}
commit-${{ github.sha }}
latest