Skip to content

Commit f36cc2e

Browse files
authored
Add a workflow to schedule an upgrade test (#260)
Call the test-upgrade workflow weekly on a Thursday and post to Slack if it is unsuccessful.
1 parent 5629467 commit f36cc2e

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Scheduled upgrade
3+
4+
permissions:
5+
contents: read
6+
packages: write
7+
id-token: write
8+
9+
on:
10+
# Run weekly on a Thursday at 6am
11+
schedule:
12+
- cron: "0 6 * * 4"
13+
14+
jobs:
15+
test_upgrade:
16+
runs-on: ubuntu-latest
17+
if: github.repository == 'azimuth-cloud/azimuth-config'
18+
steps:
19+
- name: Find latest tagged release
20+
id: get-tag
21+
run: >-
22+
echo "latest=$(gh release view --json tagName --jq .tagName)" >> "$GITHUB_OUTPUT"
23+
env:
24+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Run upgrade workflow
27+
uses: ./.github/workflows/test-upgrade.yml
28+
with:
29+
from-ref: ${{ steps.get-tag.outputs.latest }}
30+
to-ref: "devel"
31+
32+
- name: Send message to Slack
33+
uses: slackapi/slack-github-action@v2.1.1
34+
with:
35+
webhook: "${{ secrets.SLACK_WEBHOOK_URL }}"
36+
webhook-type: incoming-webook
37+
payload: |
38+
text: ":siren: Scheduled Azimuth upgrade test failed\n"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}""
39+
if: ${{ failure() }}

.github/workflows/test-upgrade.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@ permissions:
99
id-token: write
1010

1111
on:
12+
# Allow to be called by other workflows
13+
workflow_call:
14+
inputs:
15+
from-ref:
16+
description: >-
17+
The git ref to use for the initial deployment.
18+
type: string
19+
to-ref:
20+
description: >-
21+
The git ref to test an upgrade to.
22+
type: string
23+
default: devel
24+
1225
# Allow manual execution on any branch
1326
workflow_dispatch:
1427
# checkov:skip=CKV_GHA_7: "The build output cannot be affected by user parameters other than the build entry point and the top-level source location. GitHub Actions workflow_dispatch inputs MUST be empty. "

0 commit comments

Comments
 (0)