CI #285
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
# manual run | |
workflow_dispatch: | |
# weekday run | |
schedule: | |
- cron: "15 2 * * 1-5" | |
jobs: | |
build-test: | |
name: "Build & Test" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
go-version: [ '1.20', '1.19' ] | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
- name: "Setup Go" | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Download Module Deps | |
run: | | |
go mod download -x | |
- name: Build Packages | |
run: | | |
go build -v ./... | |
- name: Run Unit Tests | |
run: | | |
go test -short ./... | |
test-integration: | |
name: "Integration Tests" | |
needs: build-test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: [ '1.20', '1.19' ] | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
- name: "Setup Go" | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Download Module Deps | |
run: | | |
go mod download -x | |
- name: Run Tests | |
run: | | |
go test -v ./test/integration/... | |
test-e2e: | |
name: "E2E Tests" | |
needs: test-integration | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
go-version: [ '1.20', '1.19' ] | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
- name: "Setup Go" | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Download Module Deps | |
run: | | |
go mod download -x | |
- name: Run Tests | |
run: | | |
go test -v ./test/e2e/... | |
docker-image: | |
name: "Docker Image" | |
needs: build-test | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_BUILDKIT: 1 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
- name: "Build Image" | |
run: | | |
docker build -t vpp-probe . | |
- name: "Try Running Image" | |
run: | | |
docker run --rm -i vpp-probe |