mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
name: build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build-flagger:
|
|
runs-on:
|
|
group: "Default Larger Runners"
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 1.22.x
|
|
cache-dependency-path: |
|
|
**/go.sum
|
|
**/go.mod
|
|
- name: Download modules
|
|
run: |
|
|
go mod download
|
|
go install golang.org/x/tools/cmd/goimports
|
|
- name: Run linters
|
|
run: make fmt test-codegen
|
|
- name: Verify CRDs
|
|
run: make verify-crd
|
|
- name: Run tests
|
|
run: go test -race -coverprofile=coverage.txt -covermode=atomic $(go list ./pkg/...)
|
|
- name: Check if working tree is dirty
|
|
run: |
|
|
if [[ $(git diff --stat) != '' ]]; then
|
|
git --no-pager diff
|
|
echo 'run make test and commit changes'
|
|
exit 1
|
|
fi
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
file: ./coverage.txt
|
|
- name: Build container image
|
|
run: docker build -t test/flagger:latest .
|