mirror of
https://github.com/slackhq/nebula.git
synced 2024-09-21 07:16:14 +08:00
31ed9269d7
* add test for GOEXPERIMENT=boringcrypto * fix NebulaCertificate.Sign Set the PublicKey field in a more compatible way for the tests. The current method grabs the public key from the certificate, but the correct thing to do is to derive it from the private key. Either way doesn't really matter as I don't think the Sign method actually even uses the PublicKey field. * assert boring * cleanup tests
129 lines
2.6 KiB
YAML
129 lines
2.6 KiB
YAML
name: Build and test
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
paths:
|
|
- '.github/workflows/test.yml'
|
|
- '**Makefile'
|
|
- '**.go'
|
|
- '**.proto'
|
|
- 'go.mod'
|
|
- 'go.sum'
|
|
jobs:
|
|
|
|
test-linux:
|
|
name: Build all and test on ubuntu-linux
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Set up Go 1.20
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: "1.20"
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2
|
|
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go1.20-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go1.20-
|
|
|
|
- name: Build
|
|
run: make all
|
|
|
|
- name: Vet
|
|
run: make vet
|
|
|
|
- name: Test
|
|
run: make test
|
|
|
|
- name: End 2 end
|
|
run: make e2evv
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: e2e packet flow
|
|
path: e2e/mermaid/
|
|
if-no-files-found: warn
|
|
|
|
test-linux-boringcrypto:
|
|
name: Build and test on linux with boringcrypto
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Set up Go 1.20
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: "1.20"
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2
|
|
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go1.20-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go1.20-
|
|
|
|
- name: Build
|
|
run: make bin-boringcrypto
|
|
|
|
- name: Test
|
|
run: make test-boringcrypto
|
|
|
|
- name: End 2 end
|
|
run: make e2evv GOEXPERIMENT=boringcrypto CGO_ENABLED=1
|
|
|
|
test:
|
|
name: Build and test on ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [windows-latest, macos-11]
|
|
steps:
|
|
|
|
- name: Set up Go 1.20
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: "1.20"
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2
|
|
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go1.20-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go1.20-
|
|
|
|
- name: Build nebula
|
|
run: go build ./cmd/nebula
|
|
|
|
- name: Build nebula-cert
|
|
run: go build ./cmd/nebula-cert
|
|
|
|
- name: Vet
|
|
run: make vet
|
|
|
|
- name: Test
|
|
run: make test
|
|
|
|
- name: End 2 end
|
|
run: make e2evv
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: e2e packet flow
|
|
path: e2e/mermaid/
|
|
if-no-files-found: warn
|