Skip to content

tests

tests #872

Workflow file for this run

name: tests
on:
pull_request:
branches:
- '*'
paths-ignore:
- '**/**.md'
push:
branches:
- 'main'
tags:
- '*'
paths-ignore:
- '**/**.md'
workflow_dispatch: {}
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '^1.19'
- name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-build-codegen-
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: run lint
run: make lint
- name: Verify diff
run: make verify.diff
verify:
runs-on: ubuntu-latest
steps:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '^1.19'
- name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-build-codegen-
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Verify operator-sdk bundle consistency
run: make verify.bundle
- name: Verify manifests consistency
run: make verify.manifests
- name: Verify generators consistency
run: make verify.generators
unit-tests:
runs-on: ubuntu-latest
steps:
- name: setup golang
uses: actions/setup-go@v3
with:
go-version: '^1.19'
- name: cache go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-build-codegen-
- name: checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: run unit tests
run: make test.unit
integration-tests:
runs-on: ubuntu-latest
steps:
- name: setup golang
uses: actions/setup-go@v3
with:
go-version: '^1.19'
- name: cache go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-build-codegen-
- name: checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: run integration tests
run: make test.integration
env:
KONG_CONTROLLER_OUT: stdout
- name: upload diagnostics
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: diagnostics-integration
path: /tmp/ktf-diag*
if-no-files-found: ignore
e2e-tests:
runs-on: ubuntu-latest
steps:
- name: setup golang
uses: actions/setup-go@v3
with:
go-version: '^1.19'
- name: cache go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-build-codegen-
- name: checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: build docker image
env:
IMG: gateway-operator
TAG: e2e-${{ github.sha }}
run: make docker.build
- name: run e2e tests
run: make test.e2e
env:
KONG_TEST_GATEWAY_OPERATOR_IMAGE_LOAD: gateway-operator:e2e-${{ github.sha }}
- name: upload diagnostics
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: diagnostics-e2e
path: /tmp/ktf-diag*
if-no-files-found: ignore