-
Notifications
You must be signed in to change notification settings - Fork 13
51 lines (42 loc) · 1.29 KB
/
develop-pull-request-backend-tests.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
name: MCDA-test | pull request | back-end tests
on:
pull_request:
branches: develop
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: ['18']
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('package.json') }}
- name: run yarn
run: yarn
- name: run tests
run: yarn jest
- name: notify on slack channel on mocha failure
if: failure()
uses: rtCamp/action-slack-notify@master
env:
SLACK_WEBHOOK: ${{ secrets.slackWebhook }}
SLACK_USERNAME: gitbot
SLACK_TITLE: 'Develop pull request:'
SLACK_MESSAGE: 'Back-end tests failed'
- name: notify on slack channel on success
if: success()
uses: rtCamp/action-slack-notify@master
env:
SLACK_WEBHOOK: ${{ secrets.slackWebhook }}
SLACK_USERNAME: gitbot
SLACK_TITLE: 'Develop pull request:'
SLACK_MESSAGE: 'Back-end tests passed'