-
Notifications
You must be signed in to change notification settings - Fork 4
73 lines (61 loc) · 2.54 KB
/
push_check_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
name: Push Test Check
on:
push:
branches:
- '**'
jobs:
push_check_test:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Set up Node.js 18
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Install Landa Messenger CLI
run: npm install @landamessenger/landa-messenger-api -g
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
flutter-version: '3.24.3'
- run: flutter pub get
- run: flutter test --coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage/lcov.info
- name: Handle job completion
if: always()
run: |
if [ "${{ job.status }}" == "failure" ]; then
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🔴 Test Failed" \
--body "${{ github.repository }}: ${{ github.event.head_commit.message }}" \
--url "https://github.com/stringcare/stringcare/actions/workflows/push_check_test.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
elif [ "${{ job.status }}" == "cancelled" ]; then
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🟠 Test Canceled" \
--body "${{ github.repository }}: ${{ github.event.head_commit.message }}" \
--url "https://github.com/stringcare/stringcare/actions/workflows/push_check.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
else
landa-messenger-api chat-send \
--id "${{ secrets.CHAT_ID }}" \
--api_key "${{ secrets.CHAT_KEY }}" \
--title "🟢 Test Passed" \
--body "${{ github.repository }}: ${{ github.event.head_commit.message }}" \
--url "https://github.com/stringcare/stringcare/actions/workflows/push_check.yml" \
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \
--background_color "#55000000" \
--text_color "#FFFFFFFF"
fi