oauth2-proxy/.github/workflows/ci.yml

101 lines
2.3 KiB
YAML

name: Continuous Integration
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
permissions:
contents: read
id-token: write
jobs:
build:
runs-on: ubuntu-latest
env:
COVER: true
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Get Go version
run: |
version=$(grep "^go " go.mod | cut -d' ' -f2 | cut -d. -f1,2)
echo "version=${version}" >> "$GITHUB_OUTPUT"
id: go-version
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ steps.go-version.outputs.version }}
check-latest: true
- name: Install golangci-lint
env:
# renovate: datasource=github-tags depName=golangci/golangci-lint
GOLANGCI_LINT_VERSION: v2.11.3
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
- name: Verify Code Generation
run: |
make verify-generate
- name: Lint
run: |
make lint
- name: Build
if: (!startsWith(github.head_ref, 'release'))
run: |
make build
# For release testing
- name: Build All
if: github.base_ref == 'master' && startsWith(github.head_ref, 'release')
run: |
make release
- name: Test
run: |
make test
- name: Generate Coverage Report
if: github.event_name == 'push'
run: |
go install github.com/jandelgado/gcov2lcov@latest
gcov2lcov -infile=c.out -outfile=lcov.info
- name: Upload Coverage Report
if: github.event_name == 'push'
uses: qltysh/qlty-action/coverage@v2
with:
oidc: true
files: lcov.info
docker:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Docker Build
if: (!startsWith(github.head_ref, 'release'))
run: |
make build-docker
# For release testing
- name: Docker Build All
if: github.base_ref == 'master' && startsWith(github.head_ref, 'release')
run: |
make build-docker-all