-
Notifications
You must be signed in to change notification settings - Fork 1.5k
96 lines (81 loc) · 2.67 KB
/
build.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
name: Test pipeline
on: pull_request
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run with Node 16
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "yarn"
cache-dependency-path: pmm-app/yarn.lock
- name: Install deps
run: make prepare_release
- name: Build Grafana Dashboards
run: make build_package
- name: Upload the build artefacts
uses: actions/upload-artifact@v3
with:
name: build-dist
path: pmm-app/dist/
if-no-files-found: error
code_coverage:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "yarn"
cache-dependency-path: pmm-app/yarn.lock
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_GRAFANA_DASHBOARDS_TOKEN }}
- name: Download built packages
uses: actions/download-artifact@v3
with:
name: build-dist
path: pmm-app/dist/
- name: Install deps
run: make prepare_release
- name: Generate Coverage
run: make generate_coverage
workflow_success:
needs: [code_coverage, build]
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@v3
- name: Slack Notification
uses: percona-platform/action-slack-notify@v2
workflow_failure:
if: ${{ failure() }}
needs: [code_coverage, build]
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@v3
- name: Slack Notification
uses: percona-platform/action-slack-notify@v2