-
Notifications
You must be signed in to change notification settings - Fork 136
89 lines (77 loc) · 2.62 KB
/
daily-test.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
name: Test template (daily)
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: "8 0 * * *" # run on a daily basis
jobs:
test-template:
name: Test template
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
path: repo
- name: Setup
uses: ./repo/.github/actions/common-setup
with:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_TWEAG_JUPYTER_NIX_AUTH_TOKEN }}
- name: Initialize template
run: |
nix flake new --template github:tweag/jupyterWith example
- name: Build
run: |
cd example/
nix build
- name: Get current date
id: date
if: always()
run: echo "::set-output name=date::$(TZ=GMT date +'%Y-%m-%d %H:%M:%S %Z')"
- name: Get status
id: status
if: always()
uses: ASzc/change-string-case-action@v5
with:
string: ${{ job.status }}
- name: Get status emoji
id: status_emoji
if: always()
uses: haya14busa/action-cond@v1
with:
cond: ${{ steps.status.outputs.lowercase == 'success' }}
if_true: "🎉"
if_false: "💩"
- name: Send message to matrix
id: matrix-chat-message-always-notifiy
if: always()
uses: fadenb/[email protected]
with:
homeserver: 'matrix.org'
token: ${{ secrets.MATRIX_TOKEN }}
channel: '!JVjIaYhrLXOiLWJfnL:matrix.org' # notifications room
message: |
${{ steps.status_emoji.outputs.value }} ***${{ steps.status.outputs.uppercase }}***\
Workflow ***${{ github.workflow }}***\
Job ***${{ github.job }}***\
Triggered by ***${{ github.event_name }}***\
For `${{ github.ref }}`\
On `${{ github.sha }}`\
At ${{ steps.date.outputs.date }}\
With schedule `${{ github.event.schedule }}`
- name: Send message to matrix
id: matrix-chat-message-failure-notifiy
if: ${{ steps.status_emoji.outputs.value == 'failure' }}
uses: fadenb/[email protected]
with:
homeserver: 'matrix.org'
token: ${{ secrets.MATRIX_TOKEN }}
channel: '!hrqXNOEWKJRLLIJlcS:matrix.org' # dev room
message: |
${{ steps.status_emoji.outputs.value }} ***${{ steps.status.outputs.uppercase }}***\
Workflow ***${{ github.workflow }}***\
Job ***${{ github.job }}***\
Triggered by ***${{ github.event_name }}***\
For `${{ github.ref }}`\
On `${{ github.sha }}`\
At ${{ steps.date.outputs.date }}\
With schedule `${{ github.event.schedule }}`