Skip to content

feat: update tests

feat: update tests #70

Workflow file for this run

name: ci
on:
pull_request:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
GO_VERSION: "1.21"
jobs:
prep-matrix:
name: prep-matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set matrix
id: set-matrix
run: echo "matrix=$(ls | grep 'operator-v*' | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
lint-build-test:
name: lint-build-test
needs: prep-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
folder-path: ${{ fromJson(needs.prep-matrix.outputs.matrix) }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: ${{ matrix.folder-path }}/go.sum
- name: Run go fmt
run: go fmt ./...
working-directory: ${{ matrix.folder-path }}
- name: Run go vet
run: go vet ./...
working-directory: ${{ matrix.folder-path }}
- name: Run linters
run: make lint
working-directory: ${{ matrix.folder-path }}
- name: Install shadow
run: go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
- name: Run shadow
run: shadow ./...
working-directory: ${{ matrix.folder-path }}
- name: Build binary
run: make build
working-directory: ${{ matrix.folder-path }}
- name: Run tests
run: make test
working-directory: ${{ matrix.folder-path }}