Skip to content

Commit

Permalink
refactor cra workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
m00g3n committed Mar 29, 2024
1 parent 300cd55 commit 75c3c10
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 38 deletions.
45 changes: 9 additions & 36 deletions .github/workflows/kyma-integration-k3d-agent-tests.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
name: Run compass-rt-agemt integration tests on k3d
env:
COMPASS_CLIENT_ID: "${{ secrets.COMPASS_CLIENT_ID }}"
COMPASS_CLIENT_SECRET: "${{ secrets.COMPASS_CLIENT_SECRET }}"
COMPASS_HOST: "${{ secrets.COMPASS_HOST }}"
name: run-cra-k3d
on:
push:
branches: [ main ]
Expand All @@ -14,34 +10,11 @@ on:
- synchronize
- ready_for_review
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: azure/setup-helm@v4.1.0
id: install
- name: Checkout code
uses: actions/checkout@v3
- name: Install k3d
env:
K3D_URL: https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh
DEFAULT_K3D_VERSION: v5.6.0
run: curl --silent --fail $K3D_URL | TAG=$DEFAULT_K3D_VERSION bash
- name: Set up cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
/home/runner/work/application-connector-manager/application-connector-manager/bin
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run unit tests
run: make -C tests/hack/ci k3d-agent-tests
- name: Archive test results
if: always()
uses: actions/upload-artifact@v4
with:
name: app-gateway-test-results
path: compass-runtime-agent-test.log

run-cra-k3d:
uses: "./.github/workflows/reusable-k3d-agent-test.yml"
with:
k3d-version: v5.6.0
secrets:
compass-host: ${{ secrets.COMPASS_HOST }}
compass-client-id: ${{ secrets.COMPASS_CLIENT_ID }}
compass-client-secret: ${{ secrets.COMPASS_CLIENT_SECRET }}
50 changes: 50 additions & 0 deletions .github/workflows/reusable-k3d-agent-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: k3d CRA test
on:
workflow_call:
inputs:
k3d-version:
required: true
type: string
default: v5.6.0
secrets:
compass-host:
required: true
compass-client-id:
required: true
compass-client-secret:
required: true
jobs:
test-cra:
runs-on: ubuntu-latest
steps:
- uses: azure/setup-helm@v4.1.0
id: install-helm
- name: checkout
uses: actions/checkout@v3
- name: install-k3d
env:
K3D_URL: https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh
DEFAULT_K3D_VERSION: ${{ inputs.k3d-version }}
run: curl --silent --fail $K3D_URL | TAG=$DEFAULT_K3D_VERSION bash
- name: setup-cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
/home/runner/work/application-connector-manager/application-connector-manager/bin
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: run-tests
env:
COMPASS_CLIENT_ID: ${{ secrets.compass-client-id }}
COMPASS_CLIENT_SECRET: ${{ secrets.compass-client-secret }}
COMPASS_HOST: ${{ secrets.compass-host }}
run: make -C tests/hack/ci k3d-agent-tests
- name: archive-logs
if: always()
uses: actions/upload-artifact@v4
with:
name: app-gateway-test-results
path: compass-runtime-agent-test.log
2 changes: 0 additions & 2 deletions tests/scripts/fetch-test-logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,4 @@ function fetch_tests() {
exit $__job_result__
}

echo "host:"$COMPASS_HOST

fetch_tests $@

0 comments on commit 75c3c10

Please sign in to comment.