-
Notifications
You must be signed in to change notification settings - Fork 12
92 lines (83 loc) · 2.8 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Tests build
name: test
env:
NODE_VERSION: 20
on:
push:
branches:
- '*'
tags:
- v*
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Number of commits to fetch. 0 indicates all history.
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Run bash commands
shell: bash
run: |
ls -alt
# install deps
pnpm install
# css-tokenizer
npx lerna run --scope @adguard/css-tokenizer check-types
npx lerna run --scope @adguard/css-tokenizer lint
npx lerna run --scope @adguard/css-tokenizer test
npx lerna run --scope @adguard/css-tokenizer build
# agtree
npx lerna run --scope @adguard/agtree check-types
npx lerna run --scope @adguard/agtree lint
npx lerna run --scope @adguard/agtree test
npx lerna run --scope @adguard/agtree build
# tsurlfilter
npx lerna run --scope @adguard/tsurlfilter lint
npx lerna run --scope @adguard/tsurlfilter build
# IMPORTANT: run tests after the build because smoke tests requires a built dist dir
npx lerna run --scope @adguard/tsurlfilter test:prod
# tswebextension
npx lerna run --scope @adguard/tswebextension lint
npx lerna run --scope @adguard/tswebextension build
# IMPORTANT: run tests after the build because smoke tests requires a built dist dir
npx lerna run --scope @adguard/tswebextension test:prod
# api
npx lerna run --scope @adguard/api lint
npx lerna run --scope @adguard/api build
notify:
needs: test
# Run this job only if the previous job failed and the event was triggered by the 'AdguardTeam/tsurlfilter' repository
# Note: 'always()' is needed to run the notify job even if the test job was failed
if:
${{
always() &&
needs.test.result == 'failure' &&
github.repository == 'AdguardTeam/tsurlfilter' &&
(
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
)
}}
runs-on: ubuntu-latest
steps:
- name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: failure
fields: workflow, repo, message, commit, author, eventName, ref, job
job_name: test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}