Skip to content

Update costmanagement-metrics-operator to cc46f91 #1164

Update costmanagement-metrics-operator to cc46f91

Update costmanagement-metrics-operator to cc46f91 #1164

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- downstream
- main
jobs:
validate-pr:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
- name: Verify generated Manifests are up to date
run: make verify-manifests
unit-tests:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Display build environment
run: printenv
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run tests
run: make test
- name: Upload test coverage file
uses: actions/upload-artifact@v4
with:
name: coverage
path: cover.out
unit-tests-qemu:
strategy:
matrix:
# arch: [arm64, s390x, ppc64le] # kubebuilder is not available for s390x yet
arch: [arm64, ppc64le]
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install QEMU
uses: docker/setup-qemu-action@v3
- name: Run tests via qemu/binfmt
run: |
go env
make test-qemu
env:
GOARCH: ${{ matrix.arch }}
coverage:
needs: unit-tests
runs-on: ubuntu-22.04
steps:
- name: Checkout
# this checkout is required for the coverage report. If we don't do this, then
# the uploaded report is invalid and codecov doesn't know how to process it.
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download coverage result from unit-tests
uses: actions/download-artifact@v4
with:
name: coverage
- name: Upload coverage
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./cover.out
flags: unittests
fail_ci_if_error: true
plugin: pycoverage # Only run one plugin even though we don't want any to run.