Skip to content

add e2e tests to merge queue and use github env instead #1059

add e2e tests to merge queue and use github env instead

add e2e tests to merge queue and use github env instead #1059

Workflow file for this run

name: CI
on:
push:
branches:
- main
- "release-*"
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
pull_request:
branches:
- main
- "release-*"
merge_group:
types: [checks_requested]
workflow_dispatch:
jobs:
lint:
name: lint
needs: is_path_ignore
if: ${{ needs.is_path_ignore.outputs.should_ignore == 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: v1.21.x
cache: false
- uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
only-new-issues: true
args: --timeout=5m
verify-code:
name: Verify code
needs: is_path_ignore
if: ${{ needs.is_path_ignore.outputs.should_ignore == 'false' }}
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21.x
uses: actions/setup-go@v5
with:
go-version: 1.21.x
cache: false
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Run make verify-code
run: |
make verify-code
verify-manifests:
name: Verify manifests
needs: is_path_ignore
if: ${{ needs.is_path_ignore.outputs.should_ignore == 'false' }}
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21.x
uses: actions/setup-go@v5
with:
go-version: 1.21.x
cache: false
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Run make verify-manifests
run: |
make verify-manifests
verify-bundle:
name: Verify bundle
needs: is_path_ignore
if: ${{ needs.is_path_ignore.outputs.should_ignore == 'false' }}
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21.x
uses: actions/setup-go@v5
with:
go-version: 1.21.x
cache: false
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Run make verify-bundle
run: |
make verify-bundle
verify-helm-build:
name: Verify helm build
needs: is_path_ignore
if: ${{ needs.is_path_ignore.outputs.should_ignore == 'false' }}
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21.x
uses: actions/setup-go@v5
with:
go-version: 1.21.x
cache: false
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Run make helm-build
run: |
make verify-helm-build
verify-imports:
name: Verify imports
needs: is_path_ignore
if: ${{ needs.is_path_ignore.outputs.should_ignore == 'false' }}
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21.x
uses: actions/setup-go@v5
with:
go-version: 1.21.x
cache: false
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Run make verify-imports
run: |
make verify-imports
verify-generate:
name: Verify generate
needs: is_path_ignore
if: ${{ needs.is_path_ignore.outputs.should_ignore == 'false' }}
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21.x
uses: actions/setup-go@v5
with:
go-version: 1.21.x
cache: false
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Verify generate command
run: |
make verify-generate
verify-go-mod:
name: Verify go.mod
needs: is_path_ignore
if: ${{ needs.is_path_ignore.outputs.should_ignore == 'false' }}
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21.x
uses: actions/setup-go@v5
with:
go-version: 1.21.x
cache: false
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Verify generate command
run: |
make verify-go-mod
unit_test_suite:
name: Unit Test Suite
needs: is_path_ignore
if: ${{ needs.is_path_ignore.outputs.should_ignore == 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: v1.21
cache: false
- name: Run suite
run: |
make test-unit
integration_test_suite:
name: Integration Test Suite
needs: is_path_ignore
if: ${{ needs.is_path_ignore.outputs.should_ignore == 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: v1.21
cache: false
- name: Run suite
run: |
make test-integration
required-checks:
name: CI Required Checks
needs: [ lint, verify-code, verify-manifests, verify-bundle, verify-helm-build, verify-imports, verify-generate, verify-go-mod, unit_test_suite, integration_test_suite]
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo '${{ toJSON(needs) }}' | jq -e 'to_entries | all(.value.result == "success")'
is_path_ignore:
if: always()
name: Check for changes on path_ignore
outputs:
should_ignore: ${{ steps.is_path_ignore.outputs.should_ignore }}
runs-on:
- ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 10
- id: check_files
name: Get changed files
uses: tj-actions/changed-files@v41
with:
files: |
LICENSE
file-types: "**.adoc,**.md"
- id: set_output
name: Set output based on only files being changed that should be ignored
run: |
if [[ "${{ steps.check_files.outputs.any_changed }}" == "true" ]] && "${{ steps.check_files.outputs.files }}" != "${{ steps.check_files.outputs.all_changed_files }}"; then
echo '::set-output name=should_ignore=true'
echo "should_ignore=true" >> $GITHUB_ENV
else
echo '::set-output name=should_ignore=false'
echo "should_ignore=false" >> $GITHUB_ENV
fi