Skip to content

Commit

Permalink
test with slack
Browse files Browse the repository at this point in the history
  • Loading branch information
aalves08 committed Nov 11, 2024
1 parent 2a27bc4 commit 51bb3a5
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-extension-catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ on:
is_test:
required: false
type: string
test_repo:
test_ext_repo:
required: false
type: string
test_branch:
test_ext_branch:
required: false
type: string
secrets:
Expand All @@ -40,8 +40,8 @@ jobs:
name: Checkout repository (test flow)
uses: actions/checkout@v4
with:
repository: rancher/${{ inputs.test_repo }}
ref: ${{ inputs.test_branch }}
repository: rancher/${{ inputs.test_ext_repo }}
ref: ${{ inputs.test_ext_branch }}

- if: inputs.is_test != 'true'
name: Checkout repository (normal flow)
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build-extension-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ on:
is_test:
required: false
type: string
test_repo:
test_ext_repo:
required: false
type: string
test_branch:
test_ext_branch:
required: false
type: string

Expand All @@ -40,8 +40,8 @@ jobs:
name: Checkout (test flow)
uses: actions/checkout@v4
with:
repository: rancher/${{ inputs.test_repo }}
ref: ${{ inputs.test_branch }}
repository: rancher/${{ inputs.test_ext_repo }}
ref: ${{ inputs.test_ext_branch }}
fetch-depth: 0

- if: inputs.is_test != 'true'
Expand Down Expand Up @@ -97,12 +97,12 @@ jobs:
$publish
- name: Upload charts artifact
if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test == 'true'
if: github.ref_type == 'tag' || github.event_name != 'pull_request' || inputs.is_test == 'true'
uses: actions/upload-artifact@v3
with:
name: charts
path: tmp
## if test, check if artifacts are there...
## TODO: if test, check if artifacts are there...
release:
name: Release Build
if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') || inputs.is_test != 'true'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-shell-pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
permissions:
contents: read
packages: write
# TODO: replace "aalves08"
if: github.repository == 'aalves08/dashboard' && (github.event_name == 'workflow_call' || (github.event_name == 'push' && github.event.ref == 'refs/tags/${{ github.ref_name }}'))
steps:
- if: inputs.is_test == 'true' && inputs.test_branch != ''
Expand Down Expand Up @@ -56,10 +57,9 @@ jobs:
run: ./.github/workflows/scripts/check-package-tag-version.sh
shell: bash

# TODO: Re-enable this step before completing PR
# - name: Validate Plugin build system
# run: ./shell/scripts/test-plugins-build.sh
# shell: bash
- name: Validate Plugin build system
run: ./shell/scripts/test-plugins-build.sh
shell: bash

# Reset the local (ci) repository state because
# The previous step (Validate Plugin build system) changes
Expand Down
39 changes: 34 additions & 5 deletions .github/workflows/test-extension-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ 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
Expand All @@ -22,6 +23,8 @@ jobs:
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
Expand All @@ -39,8 +42,8 @@ jobs:
target_branch: 'gh-pages'
tagged_release: ${{ needs.retrieve-tags-master.outputs.EXTENSIONS_TAG }}
is_test: 'true'
test_repo: 'ui-plugin-examples'
test_branch: 'main'
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
Expand All @@ -53,8 +56,8 @@ jobs:
registry_user: ${{ github.actor }}
tagged_release: ${{ needs.retrieve-tags-master.outputs.ECI_TAG }}
is_test: 'true'
test_repo: 'ui-plugin-examples'
test_branch: 'main'
test_ext_repo: 'ui-plugin-examples'
test_ext_branch: 'main'
secrets:
registry_token: ${{ secrets.GITHUB_TOKEN }}
test-release-shell-pkg-master:
Expand All @@ -70,4 +73,30 @@ jobs:
with:
is_test: 'true'
test_branch: '12032-reusable-wf-tests-2'
tag: ${{ needs.retrieve-tags-master.outputs.CREATORS_TAG }}
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]
# TODO: SLACK_WEBHOOK_URL_WORKFLOWS not SLACK_WEBHOOK_URL
steps:
- name: Slack message for workflow success
env:
SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL_WORKFLOWS }}
if: success()
shell: bash
run: |
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
- name: Slack message for workflow success
env:
SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL_WORKFLOWS }}
if: success()
shell: bash
run: |
curl -X POST \
-H "Content-type: application/json; charset=utf-8" \
--data '{"name": "${{ github.job }}", "status": "Extensions workflow test failed! 🆘", "workflow_run": ${{ github.run_id }} }' \
$SLACK_URL

0 comments on commit 51bb3a5

Please sign in to comment.