Skip to content

Commit 9f7ebd9

Browse files
committed
Improve tests
1 parent 69f3bae commit 9f7ebd9

File tree

3 files changed

+25
-71
lines changed

3 files changed

+25
-71
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on: push
55
jobs:
66
lint:
77
name: Lint Check
8-
runs-on: ubuntu-18.04
8+
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@master
1111

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
release:
1010
name: Build production
11-
runs-on: ubuntu-18.04
11+
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v1
1414

.github/workflows/test.yml

Lines changed: 23 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -3,105 +3,59 @@ name: Check notification
33
on: [push]
44

55
jobs:
6-
success:
7-
name: Works properly
8-
runs-on: ubuntu-18.04
6+
notifications:
7+
name: Rocket.Chat Notifications
8+
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@master
1111

12-
- name: Rocket.Chat Notification
12+
- name: with mention
1313
uses: ./
14-
if: always()
1514
with:
1615
type: ${{ job.status }}
1716
job_name: ':robot_face: *Success*'
1817
mention: 'here'
19-
mention_if: 'failure'
20-
channel: '#develop'
2118
url: ${{ secrets.ROCKETCHAT_WEBHOOK }}
2219

23-
success_no_mention:
24-
name: Works properly without mention
25-
runs-on: ubuntu-18.04
26-
steps:
27-
- uses: actions/checkout@master
28-
29-
- name: Rocket.Chat Notification
20+
- name: with mention on success
3021
uses: ./
31-
if: always()
3222
with:
3323
type: ${{ job.status }}
34-
job_name: ':robot_face: *Success no mention*'
35-
channel: '#develop'
24+
job_name: ':robot_face: *Success*'
25+
mention: 'here'
26+
mention_if: 'success'
3627
url: ${{ secrets.ROCKETCHAT_WEBHOOK }}
3728

38-
failure:
39-
name: Works failed
40-
runs-on: ubuntu-18.04
41-
steps:
42-
- uses: actions/checkout@master
43-
44-
- name: Forced failure
45-
continue-on-error: true
46-
run: exit 1
47-
48-
- name: Rocket.Chat Notification
29+
- name: with mention on always
4930
uses: ./
50-
if: failure()
5131
with:
5232
type: ${{ job.status }}
53-
job_name: ':robot_face: *Failure*'
33+
job_name: ':robot_face: *Success*'
5434
mention: 'here'
55-
mention_if: 'failure'
56-
channel: '#develop'
35+
mention_if: 'success'
5736
url: ${{ secrets.ROCKETCHAT_WEBHOOK }}
5837

59-
- name: Check if work properly
60-
if: failure()
61-
run: |
62-
echo 'Rocket.Chat failure notification succeeded'
63-
exit 0
64-
65-
cancel:
66-
# You have to cancel this job
67-
name: Works canceled
68-
runs-on: ubuntu-18.04
69-
needs: success
70-
timeout-minutes: 1
71-
steps:
72-
- uses: actions/checkout@master
73-
74-
- name: Wait
75-
run: sleep 70
76-
77-
- name: Rocket.Chat Notification
38+
- name: with mention on failure only
7839
uses: ./
79-
if: cancelled()
8040
with:
8141
type: ${{ job.status }}
82-
job_name: ':robot_face: *Cancel*'
42+
job_name: ':robot_face: *Success no mention*'
8343
mention: 'here'
84-
mention_if: 'always'
85-
channel: '#develop'
44+
mention_if: 'failure'
8645
url: ${{ secrets.ROCKETCHAT_WEBHOOK }}
8746

88-
- name: Check if work properly
89-
if: cancelled()
90-
run: |
91-
echo 'Rocket.Chat cancelled notification succeeded'
92-
exit 0
93-
94-
commit:
95-
name: Include commit data
96-
runs-on: ubuntu-18.04
97-
steps:
98-
- uses: actions/checkout@master
47+
- name: with no mention
48+
uses: ./
49+
with:
50+
type: ${{ job.status }}
51+
job_name: ':robot_face: *Success no mention*'
52+
url: ${{ secrets.ROCKETCHAT_WEBHOOK }}
9953

100-
- uses: ./
54+
- name: with commit info
55+
uses: ./
10156
with:
10257
type: ${{ job.status }}
10358
job_name: ':robot_face: *Commit*'
104-
channel: '#develop'
105-
url: ${{ secrets.ROCKETCHAT_WEBHOOK }}
10659
commit: 'true'
60+
url: ${{ secrets.ROCKETCHAT_WEBHOOK }}
10761
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)