-
Notifications
You must be signed in to change notification settings - Fork 303
77 lines (58 loc) · 2.29 KB
/
build-and-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
name: Build and Deploy
on: ["push", "pull_request"]
jobs:
build_and_deploy:
# runs-on: [self-hosted] # Specify the label of your self-hosted runner machine
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
cache-dependency-path: package-lock.json
with:
node-version: '18'
cache: 'npm'
- name: Setup Docker
uses: docker/setup-buildx-action@v2
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
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 }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: Install dependencies
run: npm ci
- name: Bootstrap
run: npm run bootstrap
- name: Build
run: npm run build:all
- name: "Check TypeScript for @deriv/api"
run: npx tsc --project packages/api/tsconfig.json -noEmit
- name: "Check TypeScript for @deriv/hooks"
run: npx tsc --project packages/hooks/tsconfig.json -noEmit
- name: "Check TypeScript for @deriv/utils"
run: npx tsc --project packages/utils/tsconfig.json -noEmit
- name: "Check TypeScript for @deriv/analytics"
run: npx tsc --project packages/analytics/tsconfig.json -noEmit
- name: "Check TypeScript for @deriv/stores"
run: npx tsc --project packages/stores/tsconfig.json -noEmit
- name: "Check tests for @deriv/hooks"
run: bash ./scripts/check-tests.sh packages/hooks/src
- name: "Check tests for @deriv/utils"
run: bash ./scripts/check-tests.sh packages/utils/src
- name: "Check tests for @deriv/analytics"
run: bash ./scripts/check-tests.sh packages/analytics/src
- name: "Run tests"
run: npm run test