-
Notifications
You must be signed in to change notification settings - Fork 3k
66 lines (54 loc) · 1.93 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
name: Jest Unit Tests
on:
workflow_call:
pull_request:
types: [opened, synchronize]
branches-ignore: [staging, production]
paths: ['**.js', '**.ts', '**.tsx', '**.sh', 'package.json', 'package-lock.json']
jobs:
jest:
if: ${{ github.actor != 'OSBotify' && github.actor != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
env:
CI: true
strategy:
fail-fast: false
matrix:
chunk: [ 1, 2, 3 ]
name: test (job ${{ fromJSON(matrix.chunk) }})
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: ./.github/actions/composite/setupNode
- name: Get number of CPU cores
id: cpu-cores
uses: SimenB/github-actions-cpu-cores@31e91de0f8654375a21e8e83078be625380e2b18
- name: Cache Jest cache
id: cache-jest-cache
uses: actions/cache@ac25611caef967612169ab7e95533cf932c32270
with:
path: .jest-cache
key: ${{ runner.os }}-jest
- name: Jest tests
run: npx jest --silent --shard=${{ fromJSON(matrix.chunk) }}/${{ strategy.job-total }} --max-workers ${{ steps.cpu-cores.outputs.count }}
storybookTests:
if: ${{ github.actor != 'OSBotify' && github.actor != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
name: Storybook tests
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/composite/setupNode
- name: Storybook run
run: npm run storybook -- --smoke-test --ci
shellTests:
if: ${{ github.actor != 'OSBotify' && github.actor != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
name: Shell tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: ./.github/actions/composite/setupNode
- name: Test CI git logic
run: tests/unit/CIGitLogicTest.sh