Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-2.9] Add tests for workflows shipped with the creators package #13010

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/scripts/check-creators-workflows-code.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/bash

set -eo pipefail

SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
BASE_DIR="$(
cd $SCRIPT_DIR && cd ../.. &
pwd
)"

CREATOR_WORKFLOWS_DIR=$BASE_DIR/creators/extension/app/files/.github/workflows

WORKFLOW_BRANCH=$1

PROPER_WORKFLOW_CHARTS="name: Build and Release Extension Charts

on:
workflow_dispatch:
release:
types: [released]

defaults:
run:
shell: bash
working-directory: ./

jobs:
build-extension-charts:
uses: rancher/dashboard/.github/workflows/build-extension-charts.yml@$WORKFLOW_BRANCH
permissions:
actions: write
contents: write
deployments: write
pages: write
with:
target_branch: gh-pages
tagged_release: \${{ github.ref_name }}"

PROPER_WORKFLOW_CATALOG="name: Build and Release Extension Catalog

on:
workflow_dispatch:
release:
types: [released]

defaults:
run:
shell: bash
working-directory: ./

jobs:
build-extension-catalog:
uses: rancher/dashboard/.github/workflows/build-extension-catalog.yml@$WORKFLOW_BRANCH
permissions:
actions: write
contents: read
packages: write
with:
registry_target: ghcr.io
registry_user: \${{ github.actor }}
tagged_release: \${{ github.ref_name }}
secrets:
registry_token: \${{ secrets.GITHUB_TOKEN }}"

cat $CREATOR_WORKFLOWS_DIR/build-extension-charts.yml

if [ "$PROPER_WORKFLOW_CHARTS" == "$(cat $CREATOR_WORKFLOWS_DIR/build-extension-charts.yml)" ] ;then
echo "build-extension-charts workflow on creator's package is validated. proceeding..."
else
echo "build-extension-charts workflow wasn't validated correctly! stopping script"
exit 1
fi

cat $CREATOR_WORKFLOWS_DIR/build-extension-catalog.yml

if [ "$PROPER_WORKFLOW_CATALOG" == "$(cat $CREATOR_WORKFLOWS_DIR/build-extension-catalog.yml)" ] ;then
echo "build-extension-catalog workflow on creator's package is validated. All checks done"
else
echo "build-extension-catalog workflow wasn't validated correctly! stopping script"
exit 1
fi
Loading