Configure workflow #1
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: AppConfiguration-KubernetesProvider CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
outputDirectory: ${{ github.workspace }}/out | |
envtest: ${{ github.workspace }}/setup-envtest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
cache-dependency-path: ./go.sum | |
- name: Download Dependencies | |
run: go mod download | |
- name: Run Build | |
run: go build -o ${{ env.outputDirectory }}/manager ./cmd/main.go | |
- name: Run Test | |
run: | | |
echo 'Install evntest tool' | |
GOBIN=${{ env.outputDirectory }} go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest | |
echo 'Run tests' | |
KUBEBUILDER_ASSETS=$(${{ env.envtest }} use 1.19 -p path) CGO_ENABLED=0 go test ./... -coverprofile cover.out |