-
Notifications
You must be signed in to change notification settings - Fork 49
57 lines (56 loc) · 1.52 KB
/
test.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
name: Test packages
on: ['pull_request']
jobs:
format:
name: Prettier formatting
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install root dependencies
run: yarn
- name: Is formatted
run: yarn prettier:check
collect_dirs:
name: Collect package names
runs-on: ubuntu-latest
outputs:
dirs: ${{ steps.dirs.outputs.dirs }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- id: dirs
# This command will list all directories in the packages directory
run: echo "dirs=$(ls -d packages/*/ | jq --raw-input --slurp --compact-output 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT}
test:
needs: collect_dirs
name: ${{ matrix.package }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
matrix:
package: ${{ fromJson(needs.collect_dirs.outputs.dirs) }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies with Yarn workspaces
run: yarn
- name: Build
run: cd ${{ matrix.package }} && yarn build
- name: Lint
run: cd ${{ matrix.package }} && yarn lint
- name: Test
run: |
cd ${{ matrix.package }}
TEST_ADMIN_UI=true yarn test