update #32
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: Test Extension workflows | |
on: | |
# schedule: | |
# - cron: "0 0 * * *" | |
push: | |
branches: | |
- 12158-test-latest-published-versions-shell | |
- master | |
# pull_request: | |
# branches: | |
# - 12158-test-latest-published-versions-shell | |
# - master | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./ | |
jobs: | |
test-extensions-creators-and-update-paths: | |
runs-on: ubuntu-latest | |
outputs: | |
test-extensions-creators-and-update-paths-job-status: ${{ job.status }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: 12158-test-latest-published-versions-shell | |
- name: Retrieve Shell and Creators versions | |
run: .github/workflows/scripts/test-extensions-creators-build.sh | |
id: test-extensions-and-creators | |
shell: bash | |
# test-extensions-build-legacy-v1: | |
# runs-on: ubuntu-latest | |
# outputs: | |
# test-legacy-v1-job-status: ${{ job.status }} | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v4 | |
# with: | |
# ref: 12158-test-latest-published-versions-shell | |
# - name: Setup Nodejs with yarn caching | |
# uses: actions/setup-node@v4 | |
# with: | |
# node-version: '16' | |
# - name: Retrieve Shell and Creators versions | |
# run: .github/workflows/scripts/test-extensions-creators-build.sh legacy-v1 true | |
# id: test-extensions-and-creators | |
# shell: bash | |
# test-extensions-build-legacy-v2: | |
# runs-on: ubuntu-latest | |
# outputs: | |
# test-legacy-v2-job-status: ${{ job.status }} | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v4 | |
# with: | |
# ref: 12158-test-latest-published-versions-shell | |
# - name: Setup Nodejs with yarn caching | |
# uses: actions/setup-node@v4 | |
# with: | |
# node-version: '16' | |
# - name: Retrieve Shell and Creators versions | |
# run: .github/workflows/scripts/test-extensions-creators-build.sh legacy-v2 | |
# id: test-extensions-and-creators | |
# shell: bash | |
# test-extensions-build-latest: | |
# runs-on: ubuntu-latest | |
# outputs: | |
# test-latest-job-status: ${{ job.status }} | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v4 | |
# with: | |
# ref: 12158-test-latest-published-versions-shell | |
# - name: Setup Nodejs with yarn caching | |
# uses: actions/setup-node@v4 | |
# with: | |
# node-version: '16' | |
# - name: Retrieve Shell and Creators versions | |
# run: .github/workflows/scripts/test-extensions-creators-build.sh latest | |
# id: test-extensions-and-creators | |
# shell: bash | |
# retrieve-tags-master: | |
# runs-on: ubuntu-latest | |
# outputs: | |
# SHELL_TAG: ${{ steps.retrieve-data.outputs.SHELL_TAG }} | |
# CREATORS_TAG: ${{ steps.retrieve-data.outputs.CREATORS_TAG }} | |
# ECI_TAG: ${{ steps.retrieve-data.outputs.ECI_TAG }} | |
# EXTENSIONS_TAG: ${{ steps.retrieve-data.outputs.EXTENSIONS_TAG }} | |
# CURR_JOB_ID: ${{ github.job }} | |
# tags-job-status: ${{ job.status }} | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v4 | |
# with: | |
# ref: master | |
# - name: Retrieve Shell and Creators versions | |
# run: source ./.github/workflows/scripts/retrieve-versions.sh | |
# id: retrieve-data | |
# shell: bash | |
# test-build-extension-charts-master: | |
# needs: retrieve-tags-master | |
# uses: rancher/dashboard/.github/workflows/build-extension-charts.yml@master | |
# permissions: | |
# actions: write | |
# contents: write | |
# deployments: write | |
# pages: write | |
# with: | |
# target_branch: 'gh-pages' | |
# tagged_release: ${{ needs.retrieve-tags-master.outputs.EXTENSIONS_TAG }} | |
# is_test: 'true' | |
# test_ext_repo: 'ui-plugin-examples' | |
# test_ext_branch: 'main' | |
# test-build-extension-catalog-master: | |
# needs: retrieve-tags-master | |
# uses: rancher/dashboard/.github/workflows/build-extension-catalog.yml@master | |
# permissions: | |
# actions: write | |
# contents: read | |
# packages: write | |
# with: | |
# registry_target: ghcr.io | |
# registry_user: ${{ github.actor }} | |
# tagged_release: ${{ needs.retrieve-tags-master.outputs.ECI_TAG }} | |
# is_test: 'true' | |
# test_ext_repo: 'ui-plugin-examples' | |
# test_ext_branch: 'main' | |
# secrets: | |
# registry_token: ${{ secrets.GITHUB_TOKEN }} | |
# test-release-shell-pkg-master: | |
# needs: retrieve-tags-master | |
# uses: rancher/dashboard/.github/workflows/release-shell-pkg.yaml@master | |
# with: | |
# is_test: 'true' | |
# test_branch: 'master' | |
# tag: ${{ needs.retrieve-tags-master.outputs.SHELL_TAG }} | |
# test-release-creators-pkg-master: | |
# needs: retrieve-tags-master | |
# uses: rancher/dashboard/.github/workflows/release-shell-pkg.yaml@master | |
# with: | |
# is_test: 'true' | |
# test_branch: 'master' | |
# tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }} | |
# slack-message: | |
# if: ${{ always() }} | |
# runs-on: ubuntu-latest | |
# needs: [test-extensions-build-legacy-v1, test-extensions-build-legacy-v2, test-extensions-build-latest, retrieve-tags-master, test-build-extension-charts-master, test-build-extension-catalog-master, test-release-shell-pkg-master, test-release-creators-pkg-master] | |
# steps: | |
# - name: Slack message for workflow | |
# if: always() | |
# shell: bash | |
# env: | |
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} | |
# run: | | |
# OUTPUT_ARRAY=("${{ needs.retrieve-tags-master.outputs.tags-job-status }}" "${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" "${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }}" "${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }}" "${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }}") | |
# if [[ ${OUTPUT_ARRAY[@]} =~ "failure" ]]; then | |
# MSG_PREFIX="\nWorkflows testing for extensions failed! π" | |
# else | |
# MSG_PREFIX="\nWorkflows testing for extensions succedded! β " | |
# fi | |
# echo "message prefix ::: $MSG_PREFIX" | |
# TAGS_OUTPUT_STRING="Status for retrieve-tags-master - build => ${{ needs.retrieve-tags-master.outputs.tags-job-status }}" | |
# EXT_CHART_BUILD_OUTPUT_STRING="Status for test-build-extension-charts-master - build => ${{ needs.test-build-extension-charts-master.outputs.build-job-status }}" | |
# EXT_CATALOG_BUILD_OUTPUT_STRING="Status for test-build-extension-catalog-master - build => ${{ needs.test-build-extension-catalog-master.outputs.build-extension-catalog-job-status }}" | |
# RELEASE_SHELL_PKG_OUTPUT_STRING="Status for test-release-shell-pkg-master - release => ${{ needs.test-release-shell-pkg-master.outputs.build-release-shell-creators-status }}" | |
# RELEASE_CREATORS_PKG_OUTPUT_STRING="Status for test-release-creators-pkg-master - release => ${{ needs.test-release-creators-pkg-master.outputs.build-release-shell-creators-status }}" | |
# echo $TAGS_OUTPUT_STRING | |
# echo $EXT_CHART_BUILD_OUTPUT_STRING | |
# echo $EXT_CATALOG_BUILD_OUTPUT_STRING | |
# echo $RELEASE_SHELL_PKG_OUTPUT_STRING | |
# echo $RELEASE_CREATORS_PKG_OUTPUT_STRING | |
# MSG="$MSG_PREFIX \n::: $TAGS_OUTPUT_STRING \n::: $EXT_CHART_BUILD_OUTPUT_STRING \n::: $EXT_CATALOG_BUILD_OUTPUT_STRING \n::: $RELEASE_SHELL_PKG_OUTPUT_STRING \n::: $RELEASE_CREATORS_PKG_OUTPUT_STRING" | |
# echo "message sent: $MSG" | |
# curl -X POST -H 'Content-type: application/json; charset=utf-8' \ | |
# --data "{\"branch\": \"master\", \"message\": \"$MSG\", \"workflow_run\": ${{ github.run_id }} }" $SLACK_WEBHOOK | |
################### | |
# THIS ONE WORKS JUST FINE!!!!! | |
################### | |
# slack-message: | |
# if: ${{ always() }} | |
# runs-on: ubuntu-latest | |
# needs: [test-extensions-build-legacy-v1, test-extensions-build-legacy-v2, test-extensions-build-latest] | |
# steps: | |
# - name: Slack message for workflow | |
# if: always() | |
# shell: bash | |
# env: | |
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} | |
# run: | | |
# OUTPUT_ARRAY=("${{ needs.test-extensions-build-legacy-v1.outputs.test-legacy-v1-job-status }}" "${{ needs.test-extensions-build-legacy-v2.outputs.test-legacy-v2-job-status }}" "${{ needs.test-extensions-build-latest.outputs.test-latest-job-status }}") | |
# JOB_NAME_ARRAY=("test-extensions-build-legacy-v1 job" "test-extensions-build-legacy-v2 job" "test-extensions-build-latest job") | |
# if [[ ${OUTPUT_ARRAY[@]} =~ "failure" ]]; then | |
# MSG_PREFIX="\nWorkflows testing for extensions failed! π" | |
# else | |
# MSG_PREFIX="\nWorkflows testing for extensions succedded! β " | |
# fi | |
# echo "message prefix ::: $MSG_PREFIX" | |
# MSG_OUTPUT="$MSG_PREFIX" | |
# for index in "${!OUTPUT_ARRAY[@]}" | |
# do | |
# if [[ ${OUTPUT_ARRAY[$index]} == "failure" ]]; then | |
# EMOJI="π" | |
# else | |
# EMOJI="β " | |
# fi | |
# MSG_OUTPUT="$MSG_OUTPUT \n::: Status for ${JOB_NAME_ARRAY[$index]} => ${OUTPUT_ARRAY[$index]} $EMOJI" | |
# done | |
# echo "message sent: $MSG_OUTPUT" | |
# curl -X POST -H 'Content-type: application/json; charset=utf-8' \ | |
# --data "{\"branch\": \"master\", \"message\": \"$MSG\", \"workflow_run\": ${{ github.run_id }} }" $SLACK_WEBHOOK | |
slack-message: | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
needs: [test-extensions-creators-and-update-paths] | |
steps: | |
- name: Slack message for workflow | |
if: always() | |
shell: bash | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} | |
run: | | |
OUTPUT_ARRAY=("${{ needs.test-extensions-creators-and-update-paths-job-status.outputs.test-legacy-v1-job-status }}") | |
JOB_NAME_ARRAY=("test-extensions-creators-and-update-paths-job-status job") | |
if [[ ${OUTPUT_ARRAY[@]} =~ "failure" ]]; then | |
MSG_PREFIX="\nWorkflows testing for extensions failed! π" | |
else | |
MSG_PREFIX="\nWorkflows testing for extensions succedded! β " | |
fi | |
echo "message prefix ::: $MSG_PREFIX" | |
MSG_OUTPUT="$MSG_PREFIX" | |
for index in "${!OUTPUT_ARRAY[@]}" | |
do | |
if [[ ${OUTPUT_ARRAY[$index]} == "failure" ]]; then | |
EMOJI="π" | |
else | |
EMOJI="β " | |
fi | |
MSG_OUTPUT="$MSG_OUTPUT \n::: Status for ${JOB_NAME_ARRAY[$index]} => ${OUTPUT_ARRAY[$index]} $EMOJI" | |
done | |
echo "message sent: $MSG_OUTPUT" | |
curl -X POST -H 'Content-type: application/json; charset=utf-8' \ | |
--data "{\"branch\": \"master\", \"message\": \"$MSG_OUTPUT\", \"workflow_run\": ${{ github.run_id }} }" $SLACK_WEBHOOK |