Gitlab runner scaler #11550
Workflow file for this run
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: CI | |
on: | |
- pull_request | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
validate: | |
name: validate - ${{ matrix.name }} | |
runs-on: ${{ matrix.runner }} | |
container: ghcr.io/kedacore/keda-tools:1.23.3 | |
strategy: | |
matrix: | |
include: | |
- runner: ARM64 | |
name: arm64 | |
- runner: ubuntu-latest | |
name: amd64 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
fetch-depth: 1 | |
- name: Install prerequisites | |
run: | | |
apt-get update | |
apt-get install -y jq python3-yaml | |
- name: Register workspace path | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: Check go version | |
run: go version | |
- name: Set Go paths | |
id: go-paths | |
run: | | |
echo "mod_cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT | |
echo "build_cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT | |
- name: Go modules cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: ${{ steps.go-paths.outputs.mod_cache }} | |
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | |
- name: Go build cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: ${{ steps.go-paths.outputs.build_cache }} | |
key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} | |
- name: Go modules sync | |
run: go mod tidy -compat=1.23 | |
- name: Verify generated Clientset is up to date | |
run: make clientset-verify | |
- name: Verify generated Manifests are up to date | |
run: make verify-manifests | |
- name: Build | |
run: make build | |
- name: Test | |
run: make test | |
- name: Create test Summary | |
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4 | |
with: | |
paths: "report.xml" | |
if: always() | |
validate-dockerfiles: | |
permissions: | |
contents: read # for dorny/paths-filter to fetch a list of changed files | |
pull-requests: read # for dorny/paths-filter to read pull requests | |
name: validate-dockerfiles - ${{ matrix.name }} | |
runs-on: ${{ matrix.runner }} | |
container: ghcr.io/kedacore/keda-tools:1.23.3 | |
strategy: | |
matrix: | |
include: | |
- runner: ARM64 | |
name: arm64 | |
- runner: ubuntu-latest | |
name: amd64 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
fetch-depth: 1 | |
- name: Register workspace path | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3 | |
id: filter | |
with: | |
filters: | | |
dockerfiles: | |
- 'Dockerfile*' | |
- name: Build images | |
if: steps.filter.outputs.dockerfiles == 'true' | |
run: make docker-build | |
validate-dev-container: | |
permissions: | |
contents: read # for dorny/paths-filter to fetch a list of changed files | |
pull-requests: read # for dorny/paths-filter to read pull requests | |
name: Validate dev-container - ${{ matrix.name }} | |
runs-on: ${{ matrix.runner }} | |
container: ghcr.io/kedacore/keda-tools:1.23.3 | |
strategy: | |
matrix: | |
include: | |
- runner: ARM64 | |
name: arm64 | |
- runner: ubuntu-latest | |
name: amd64 | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Register workspace path | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3 | |
id: filter | |
with: | |
filters: | | |
devcontainer: | |
- '.devcontainer/Dockerfile' | |
- name: Build tools | |
if: steps.filter.outputs.devcontainer == 'true' | |
run: make docker-build-dev-containers | |
statics: | |
name: Static Checks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: 3.x | |
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5 | |
with: | |
go-version: "1.23" | |
- name: Get golangci | |
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.61.0 | |
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 | |
trivy-scan: | |
uses: kedacore/keda/.github/workflows/template-trivy-scan.yml@main | |
with: | |
runs-on: ubuntu-latest | |
scan-type: "fs" | |
format: "table" | |
output: "" | |
exit-code: 1 | |
publish: false |