2019-12-11 08:19:06 -07:00
|
|
|
name: Build and test
|
2019-12-11 20:47:40 -07:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
2020-03-02 14:21:19 -07:00
|
|
|
paths:
|
|
|
|
- '.github/workflows/test.yml'
|
|
|
|
- '**Makefile'
|
|
|
|
- '**.go'
|
|
|
|
- '**.proto'
|
|
|
|
- 'go.mod'
|
|
|
|
- 'go.sum'
|
2019-12-11 08:19:06 -07:00
|
|
|
jobs:
|
|
|
|
|
|
|
|
test-linux:
|
|
|
|
name: Build all and test on ubuntu-linux
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
2022-04-05 15:08:00 -06:00
|
|
|
- name: Set up Go 1.18
|
2021-10-21 15:24:11 -06:00
|
|
|
uses: actions/setup-go@v2
|
2019-12-11 08:19:06 -07:00
|
|
|
with:
|
2022-04-05 15:08:00 -06:00
|
|
|
go-version: 1.18
|
2019-12-11 08:19:06 -07:00
|
|
|
id: go
|
|
|
|
|
|
|
|
- name: Check out code into the Go module directory
|
2021-10-21 15:24:11 -06:00
|
|
|
uses: actions/checkout@v2
|
2019-12-11 08:19:06 -07:00
|
|
|
|
2021-10-21 15:24:11 -06:00
|
|
|
- uses: actions/cache@v2
|
2020-03-02 14:21:19 -07:00
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
2022-04-05 15:08:00 -06:00
|
|
|
key: ${{ runner.os }}-go1.18-${{ hashFiles('**/go.sum') }}
|
2020-03-02 14:21:19 -07:00
|
|
|
restore-keys: |
|
2022-04-05 15:08:00 -06:00
|
|
|
${{ runner.os }}-go1.18-
|
2020-03-02 14:21:19 -07:00
|
|
|
|
2019-12-11 08:19:06 -07:00
|
|
|
- name: Build
|
|
|
|
run: make all
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: make test
|
|
|
|
|
2021-03-31 09:26:35 -06:00
|
|
|
- name: End 2 end
|
2021-04-30 17:19:40 -06:00
|
|
|
run: make e2evv
|
2021-03-31 09:26:35 -06:00
|
|
|
|
2022-06-27 11:33:29 -06:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: e2e packet flow
|
|
|
|
path: e2e/mermaid/
|
|
|
|
if-no-files-found: warn
|
|
|
|
|
2019-12-11 08:19:06 -07:00
|
|
|
test:
|
|
|
|
name: Build and test on ${{ matrix.os }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-11-09 09:49:54 -07:00
|
|
|
os: [windows-latest, macos-11]
|
2019-12-11 08:19:06 -07:00
|
|
|
steps:
|
|
|
|
|
2022-04-05 15:08:00 -06:00
|
|
|
- name: Set up Go 1.18
|
2021-10-21 15:24:11 -06:00
|
|
|
uses: actions/setup-go@v2
|
2019-12-11 08:19:06 -07:00
|
|
|
with:
|
2022-04-05 15:08:00 -06:00
|
|
|
go-version: 1.18
|
2019-12-11 08:19:06 -07:00
|
|
|
id: go
|
|
|
|
|
|
|
|
- name: Check out code into the Go module directory
|
2021-10-21 15:24:11 -06:00
|
|
|
uses: actions/checkout@v2
|
2019-12-11 08:19:06 -07:00
|
|
|
|
2021-10-21 15:24:11 -06:00
|
|
|
- uses: actions/cache@v2
|
2020-03-02 14:21:19 -07:00
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
2022-04-05 15:08:00 -06:00
|
|
|
key: ${{ runner.os }}-go1.18-${{ hashFiles('**/go.sum') }}
|
2020-03-02 14:21:19 -07:00
|
|
|
restore-keys: |
|
2022-04-05 15:08:00 -06:00
|
|
|
${{ runner.os }}-go1.18-
|
2020-03-02 14:21:19 -07:00
|
|
|
|
2019-12-11 08:19:06 -07:00
|
|
|
- name: Build nebula
|
|
|
|
run: go build ./cmd/nebula
|
|
|
|
|
|
|
|
- name: Build nebula-cert
|
|
|
|
run: go build ./cmd/nebula-cert
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: go test -v ./...
|
2021-03-31 09:26:35 -06:00
|
|
|
|
|
|
|
- name: End 2 end
|
2021-04-30 17:19:40 -06:00
|
|
|
run: make e2evv
|
2022-06-27 11:33:29 -06:00
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: e2e packet flow
|
|
|
|
path: e2e/mermaid/
|
|
|
|
if-no-files-found: warn
|