-
Notifications
You must be signed in to change notification settings - Fork 63
51 lines (42 loc) · 1.65 KB
/
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
name: test🧪
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: npm install
- name: Test
run: npm test
- name: Comment to PR
if: failure() && github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
with:
message: "⚠️ The tests have failed, @${{ github.actor }} Please review the proposed changes."
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Send message to Discord
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
if: failure() && github.event_name == 'pull_request'
uses: Ilshidur/action-discord@master
with:
args: |
⚠️ The GitHub event `${{ github.event_name }}` has failed.
**Repository**: `${{ github.repository }}`
**Workflow**: `${{ github.workflow }}`
**Actor**: `${{ github.actor }}`
**Pull Request**: [Link](${{ github.event.pull_request.html_url }})
**Action URL**: [View Details](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
Please review the proposed changes.