fix resource resolving for nested components #1044
Workflow file for this run
This file contains hidden or 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: CI | |
on: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- 'docs/**' | |
workflow_call: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read # for actions/checkout to fetch code | |
jobs: | |
tests: | |
runs-on: large_runner | |
steps: | |
- name: Self Hosted Runner Post Job Cleanup Action | |
uses: TooMuch4U/actions-clean@9b358e33df99574ac0bdf2e92fa3db1ae1415563 # v2.2 | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup Go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
with: | |
go-version-file: '${{ github.workspace }}/go.mod' | |
cache: false | |
- name: Get Go environment | |
run: | | |
echo "go_cache=$(go env GOCACHE)" >> $GITHUB_ENV | |
echo "go_modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV | |
- name: Set up cache | |
# https://github.com/actions/setup-go/issues/358 - cache is not working with setup-go for multiple jobs | |
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
with: | |
path: | | |
${{ env.go_cache }} | |
${{ env.go_modcache }} | |
key: ${{ env.cache_name }}-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ hashFiles('**/go.mod') }} | |
restore-keys: | | |
${{ env.cache_name }}-${{ runner.os }}-go- | |
env: | |
cache_name: controller-tests | |
- name: Restore K8s Cache | |
id: cache-k8s-restore | |
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
with: | |
path: | | |
bin/k8s | |
key: ${{ runner.os }}-k8s | |
- name: Run tests | |
run: make test | |
- name: Save K8s Cache | |
id: cache-k8s-save | |
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
with: | |
path: | | |
bin/k8s | |
key: ${{ steps.cache-k8s-restore.outputs.cache-primary-key }} | |
e2e-tests: | |
runs-on: large_runner | |
steps: | |
- name: Self Hosted Runner Post Job Cleanup Action | |
uses: TooMuch4U/actions-clean@9b358e33df99574ac0bdf2e92fa3db1ae1415563 # v2.2 | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup Go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
with: | |
go-version-file: '${{ github.workspace }}/go.mod' | |
cache: false | |
- name: Get Go environment | |
run: | | |
echo "go_cache=$(go env GOCACHE)" >> $GITHUB_ENV | |
echo "go_modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV | |
- name: Set up cache | |
# https://github.com/actions/setup-go/issues/358 - cache is not working with setup-go for multiple jobs | |
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
with: | |
path: | | |
${{ env.go_cache }} | |
${{ env.go_modcache }} | |
bin/k8s | |
key: ${{ env.cache_name }}-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ hashFiles('**/go.mod') }} | |
restore-keys: | | |
${{ env.cache_name }}-${{ runner.os }}-go- | |
env: | |
cache_name: integration-test | |
- name: Setup ocm | |
uses: open-component-model/ocm-setup-action@655f3525fd283ca7d22e6b2ceec42324331df401 # v1.0.0 | |
- name: Setup Flux CLI | |
uses: fluxcd/flux2/action@b73c7f7191086ca7629840e680e71873349787f8 # v2.6.1 | |
- name: Run e2e test | |
run: | | |
./test/e2e/hacks/setup.sh | |
source ./test/e2e/hacks/.env | |
make test-e2e | |
- name: Publish logs on failure | |
if: failure() | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
env: | |
CONTROLLER_LOG_PATH: ocm-k8s-toolkit-controller.log | |
with: | |
name: controller-logs | |
# Currently, it is planned that the integration tests runs on every commit on a PR. Therefore, we could | |
# produce a lot of logs. To not clutter the storage, the retention-days are reduced to 1. | |
retention-days: 1 | |
path: | | |
ocm-k8s-toolkit-controller.log |