Skip to content

Deployed status as available deployment #1362

Deployed status as available deployment

Deployed status as available deployment #1362

Workflow file for this run

name: PR Test operator
on:
pull_request:
branches:
- main
- rhdh-1.[0-9]+
- 1.[0-9]+.x
- release-1.[0-9]+
jobs:
pr-validate:
name: PR Validate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
# check changes in this commit for regex include and exclude matches
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45.0.6
with:
files: |
.github/workflows/pr.yaml
Makefile
**/*.go
bundle/**
config/**
go.mod
go.sum
files_ignore: |
**/*.md
**/*.adoc
.rhdh/**
- name: List all changed files (for troubleshooting)
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
- name: Setup Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5
with:
go-version-file: 'go.mod'
# gosec needs a "build" stage so connect it to the lint step which we always do
- name: build
run: make lint
- name: Start Minikube
# run this stage only if there are changes that match the includes and not the excludes
if: steps.changed-files.outputs.any_changed == 'true'
uses: medyagh/setup-minikube@d8c0eb871f6f455542491d86a574477bd3894533 # v0.0.18
- name: Run Controller
# run this stage only if there are changes that match the includes and not the excludes
if: steps.changed-files.outputs.any_changed == 'true'
run: make install run &
- name: Test
# run this stage only if there are changes that match the includes and not the excludes
if: steps.changed-files.outputs.any_changed == 'true'
run: make test
- name: Generic Integration test
# run this stage only if there are changes that match the includes and not the excludes
# perform it on backstage.io for speed
if: steps.changed-files.outputs.any_changed == 'true'
run: make integration-test PROFILE=backstage.io USE_EXISTING_CLUSTER=true USE_EXISTING_CONTROLLER=true
- name: RHDH specific Integration test
# run this stage only if there are changes that match the includes and not the excludes
if: steps.changed-files.outputs.any_changed == 'true'
run: make integration-test ARGS='--focus "create default rhdh"' USE_EXISTING_CLUSTER=true USE_EXISTING_CONTROLLER=true
- name: Run Gosec Security Scanner
run: make gosec
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@d68b2d4edb4189fd2a5366ac14e72027bd4b37dd # v3
with:
# Path to SARIF file relative to the root of the repository
sarif_file: gosec.sarif