-
-
Notifications
You must be signed in to change notification settings - Fork 84
59 lines (48 loc) · 1.6 KB
/
checks.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
name: Checks and Tests
on:
push:
pull_request:
env:
# Package name in the monorepo
test_app_package_name: test-test
jobs:
checks:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install
uses: ./.github/actions/install
with:
workspace-focus: ${{ env.test_app_package_name }}
- name: Check
run: yarn check
- name: Lint
run: yarn lint
tests:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install
uses: ./.github/actions/install
# with:
# workspace-focus: ${{ env.test_app_package_name }}
- name: Test
run: yarn test
notify:
needs: [checks, tests]
runs-on: ubuntu-latest
if: failure()
steps:
- name: Notify Discord on failure
run: |
echo "Checks or tests failed, sending message to Discord..."
curl -H "Content-Type: application/json" \
-X POST \
-d '{
"content": "🚨 Checks or tests failed for commit `${{ github.sha }}` in [${{ github.repository }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}).\nSee the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})."
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}