generated from networkservicemesh/cmd-template
-
Notifications
You must be signed in to change notification settings - Fork 10
83 lines (73 loc) · 2.39 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
82
83
---
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: "sdk, api, sdk-vpp, sdk-sriov, govpp, vpphelper"
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-build-and-test:
if: github.repository != 'networkservicemesh/cmd-template'
uses: networkservicemesh/.github/.github/workflows/docker-build-and-test.yaml@main
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
docker-publish:
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: 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