forked from rancher/dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (117 loc) · 4.52 KB
/
test-extension-workflows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Test Extension workflows
on:
push:
branches:
- 12032-reusable-wf-tests-2
# schedule:
# - cron: "0 0 * * *"
defaults:
run:
shell: bash
working-directory: ./
# TODO: replace all instances of "aalves08" and "12032-reusable-wf-tests-2"
jobs:
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 }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: 12032-reusable-wf-tests-2
- name: Retrieve Shell and Creators versions
run: source ./shell/scripts/retrieve-versions.sh
id: retrieve-data
shell: bash
test-build-extension-charts-master:
needs: retrieve-tags-master
uses: aalves08/dashboard/.github/workflows/build-extension-charts.yml@12032-reusable-wf-tests-2
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: aalves08/dashboard/.github/workflows/build-extension-catalog.yml@12032-reusable-wf-tests-2
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: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2
# with:
# is_test: 'true'
# test_branch: '12032-reusable-wf-tests-2'
# tag: ${{ needs.retrieve-tags-master.outputs.SHELL_TAG }}
# test-release-creators-pkg-master:
# needs: retrieve-tags-master
# uses: aalves08/dashboard/.github/workflows/release-shell-pkg.yaml@12032-reusable-wf-tests-2
# with:
# is_test: 'true'
# test_branch: '12032-reusable-wf-tests-2'
# tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }}
slack-message:
if: ${{ always() }}
runs-on: ubuntu-latest
# needs: [retrieve-tags-master, test-build-extension-charts-master, test-build-extension-catalog-master, test-release-shell-pkg-master, test-release-creators-pkg-master]
needs: [retrieve-tags-master, test-build-extension-charts-master, test-build-extension-catalog-master]
# TODO: SLACK_WEBHOOK_URL_EXT_WFS not SLACK_WEBHOOK_URL
steps:
- name: Slack message for workflow
if: always()
# shell: bash
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }}
run: |
succeeded=()
failed=()
for job in retrieve-tags-master test-build-extension-charts-master test-build-extension-catalog-master; do
if [[ ${{ job.outputs.result }} == 'success' ]]; then
succeeded+=("$job")
else
failed+=("$job")
fi
done
if [[ -n "${succeeded[*]}" ]]; then
succeeded_message="✅ The following jobs succeeded:\n${succeeded[*]}"
fi
if [[ -n "${failed[*]}" ]]; then
failed_message="❌ The following jobs failed:\n${failed[*]}"
fi
echo "succeeded ::: $succeeded"
echo "failed ::: $failed"
curl -X POST -H 'Content-type: application/json; charset=utf-8' \
--data '{ branch: "master", message: "$succeeded_message ::: $failed_message"}' $SLACK_WEBHOOK
# - name: Slack message for workflow success
# env:
# SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# if: success()
# shell: bash
# run: |
# echo "JOBS SUCCEEDED: ${{ github.job }}"
# curl -X POST \
# -H "Content-type: application/json; charset=utf-8" \
# --data '{"name": "${{ github.job }}", "status": "Extensions workflow test succedded! ✅", "workflow_run": ${{ github.run_id }} }' \
# $SLACK_URL