-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (51 loc) · 1.69 KB
/
tests.yaml
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
on:
# Workflow dispatch is used for manual triggers
workflow_dispatch:
# Workflow call is used for called from another workflow
workflow_call:
jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install pre-commit
run: pip install pre-commit
- name: Cache pre-commit environment
uses: actions/cache@v3
env:
cache-name: cache-pre-commit
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./.pre-commit-config.yaml')}}
- name: Run pre-commit
env:
# These need node_modules, and will be covered in the build step anyway
SKIP: type_check_core,type_check_plugins
run: pre-commit run --all-files
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: actions/setup-node@v3
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
./node_modules
./example/node_modules
./packages/dm-core/node_modules
./packages/dm-core-plugins/node_modules
./yarn.lock
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./packages/dm-core/package.json')}}-${{ hashFiles('./packages/dm-core-plugins/package.json') }}
- name: 'Install dependencies'
run: yarn install
- name: 'Build packages'
run: yarn build:packages
- name: 'Test packages'
run: yarn test:packages