-
Notifications
You must be signed in to change notification settings - Fork 66
79 lines (76 loc) · 2.17 KB
/
install-test.yaml
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
name: Install Test
on:
schedule:
- cron: '45 23 * * *'
workflow_dispatch:
jobs:
install:
name: Install and test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
- name: install
run: |
npm install @flowfuse/flowfuse
mkdir etc var
cp node_modules/@flowfuse/flowfuse/etc/flowforge.yml etc/
ls -lh node_modules/.bin
- name: start server in background
uses: JarvusInnovations/background-action@v1
with:
run: |
node_modules/.bin/flowfuse
wait-on: |
http://localhost:3000
tail: true
wait-for: 2m
log-output: stderr,stdout
log-output-if: failure
- name: test access
run: |
curl -L -v http://localhost:3000
notify-slack:
name: Notify about test failure
needs: [install]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Post to a Slack channel
id: slack
uses: slackapi/[email protected]
with:
channel-id: 'C067BD0377F'
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":x: ${{ github.workflow }} workflow failed",
"emoji": true
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<${{ github.server_url }}/${{ github.repository }}/actions/workflows/install-test.yaml|${{ github.workflow }}> workflow failed to complete successfully."
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Workflow run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View>"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_GHBOT_TOKEN }}