-
Notifications
You must be signed in to change notification settings - Fork 1.5k
83 lines (72 loc) · 2.48 KB
/
dashboard.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
name: Test pipeline
on:
pull_request:
# paths:
# - 'dashboards/**'
jobs:
cleanup_and_check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt
- name: Get all test, doc and src files that have changed
id: changed-files-yaml
uses: tj-actions/changed-files@v44
with:
files_yaml: |
dashboards:
- dashboards/**
- name: Run cleanup-dash.py on changed files
if: steps.changed-files-yaml.outputs.test_any_changed == 'true'
env:
TEST_ALL_CHANGED_FILES: ${{ steps.changed-files-yaml.outputs.test_all_changed_files }}
run: |
for file in ${TEST_ALL_CHANGED_FILES}; do
python cleanup-dash.py "$file"
done
- name: Check for changes
run: |
git diff --exit-code
workflow_success:
needs: [ cleanup_and_check ]
name: Slack Notification success
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNEL: "pmm-ci"
SLACK_USERNAME: "PR pipelines bot"
SLACK_ICON_EMOJI: ":octocat:"
SLACK_COLOR: "#00FF00"
SLACK_TITLE: "Finished grafana-dashboards workflow"
SLACK_MESSAGE: "${{ github.event.inputs.repo || github.repository }}:${{ github.event.inputs.branch || github.head_ref }}"
SLACK_FOOTER: "Please check the Actions URL ^"
steps:
- uses: actions/checkout@v4
- name: Slack Notification
uses: percona/gh-action-action-slack-notify@v2
workflow_failure:
if: ${{ failure() }}
needs: [ cleanup_and_check ]
name: Slack Notification failure
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNEL: "pmm-ci"
SLACK_USERNAME: "PR pipelines bot"
SLACK_ICON_EMOJI: ":octocat:"
SLACK_COLOR: "#FF0000"
SLACK_TITLE: "Finished grafana-dashboards workflow"
SLACK_MESSAGE: "Workflow failed: ${{ github.event.inputs.repo || github.repository }}:${{ github.event.inputs.branch || github.head_ref }}"
SLACK_FOOTER: "Please check the Actions URL ^"
steps:
- uses: actions/checkout@v4
- name: Slack Notification
uses: percona/gh-action-action-slack-notify@v2