GRC Integration Test #1591
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: GRC Integration Test | |
on: | |
schedule: | |
- cron: "0 5,11,14,17,20,23 * * 0-6" # UTC 0,6,9,12,15,18 in EASTERN STANDARD | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
e2e: | |
name: KinD E2E | |
uses: ./.github/workflows/kind.yml | |
integration: | |
name: Integration Tests | |
runs-on: ubuntu-latest | |
env: | |
MANAGED_CLUSTER_NAME: "local-cluster" | |
outputs: | |
START_TIME: ${{ steps.start-time.outputs.START_TIME }} | |
steps: | |
- name: Set start timestamp | |
id: start-time | |
run: | | |
echo "START_TIME=$(date)" >> "$GITHUB_OUTPUT" | |
- name: Checkout Policy Framework | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Cluster setup | |
run: | | |
echo "::group::Set up prerequisites" | |
./build/download-clis.sh | |
make e2e-dependencies | |
oc login ${{ secrets.E2E_URL }} --insecure-skip-tls-verify=true -u ${{ secrets.E2E_USER }} -p ${{ secrets.E2E_PASSWORD }} | |
make e2e-setup-kube | |
echo "::endgroup::" | |
echo "::group::Patch images to latest" | |
./build/patch-dev-images.sh | |
echo "::endgroup::" | |
echo "::group::Clean cluster" | |
./build/clean-up-cluster.sh | |
echo "::endgroup::" | |
- name: Integration Test | |
shell: bash | |
env: | |
MANAGED_CLUSTER_NAME: "local-cluster" | |
TEST_ARGS: "--label-filter=!etcd --json-report=report.json --junit-report=report.xml --output-dir=test-output" | |
run: | | |
make integration-test | |
- name: etcd Encryption Test | |
shell: bash | |
env: | |
MANAGED_CLUSTER_NAME: "local-cluster" | |
TEST_ARGS: "--label-filter=etcd --json-report=etcd-report.json --junit-report=etcd-report.xml --output-dir=test-output" | |
run: | | |
make integration-test | |
- name: Upload Test Reports | |
if: ${{ !cancelled() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: integration-report | |
path: | | |
test-output/report.xml | |
test-output/report.json | |
test-output/etcd-report.xml | |
test-output/etcd-report.json | |
ff: | |
name: Fast Forward | |
needs: [ e2e, integration ] | |
runs-on: ubuntu-latest | |
if: ${{ vars.FAST_FORWARD == 'true' }} | |
env: | |
GITHUB_USER: ${{ secrets.WORKFLOW_USER }} | |
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} | |
steps: | |
- name: Checkout Policy Framework | |
uses: actions/checkout@v4 | |
- run: | | |
COMMIT_TIME="${{ needs.integration.outputs.START_TIME }}" ./build/main-branch-sync/sync.sh | |
slack: | |
name: Send result to Slack | |
needs: [ e2e, integration, ff ] | |
runs-on: ubuntu-latest | |
if: ${{ always() }} | |
steps: | |
- name: Checkout Policy Framework | |
uses: actions/checkout@v4 | |
with: | |
path: framework | |
- uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Format result message | |
env: | |
ARTIFACTS_PATH: artifacts | |
WF_LINK: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow run>" | |
WF_CONCLUSION: ${{ contains(needs.*.result, 'failure') && 'failed' || contains(needs.*.result, 'cancelled') && 'cancelled' || 'succeeded' }} | |
GH_NEEDS_CTX: ${{ toJSON(needs) }} | |
ORIGIN: "${{ github.repository }} ${{ github.workflow }}" | |
run: | | |
./framework/build/periodic-slack-report.sh | |
- uses: slackapi/slack-github-action@v1.27.0 | |
env: | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | |
SLACK_WEBHOOK_URL: ${{ secrets.E2E_SLACK_WEBHOOK }} | |
with: | |
payload-file-path: artifacts/slack-payload.json |