-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
128 lines (106 loc) · 4.18 KB
/
Copy pathci-quality-checks.yml
File metadata and controls
128 lines (106 loc) · 4.18 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: 🧪 CI Test
on:
push:
branches:
- dev
pull_request:
branches:
- dev
types:
- opened
- synchronize
- reopened
- ready_for_review
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
env:
TURBO_TELEMETRY_DISABLED: '1'
jobs:
test-shard:
name: test shard (${{ matrix.shard-index }}/${{ matrix.shard-total }})
if: github.repository == 'dream-num/univer' && (github.event_name != 'pull_request' || !github.event.pull_request.draft)
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
shard-index: [1, 2, 3, 4]
shard-total: [4]
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: 🩺 Run test
run: node --experimental-strip-types ./scripts/coverage-shard.mts --shard-index=${{ matrix.shard-index }} --shard-total=${{ matrix.shard-total }} --concurrency=2
- name: 🧬 Report coverage
uses: codecov/codecov-action@v7
with:
name: unit-${{ matrix.shard-index }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
test:
name: test
if: always() && github.repository == 'dream-num/univer' && (github.event_name != 'pull_request' || !github.event.pull_request.draft)
runs-on: minimum-runner
timeout-minutes: 5
needs: test-shard
steps:
- name: Check test shard results
run: |
if [ "${{ needs.test-shard.result }}" != "success" ]; then
echo "One or more test shards failed: ${{ needs.test-shard.result }}"
exit 1
fi
echo "All test shards passed"
eslint:
if: github.repository == 'dream-num/univer' && (github.event_name != 'pull_request' || !github.event.pull_request.draft)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Restore ESLint cache
id: eslint-cache
uses: actions/cache/restore@v6
with:
path: .eslintcache
key: eslint-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'package.json', 'eslint.config.ts') }}-${{ github.sha }}
restore-keys: |
eslint-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'package.json', 'eslint.config.ts') }}-
- name: 🌡️ Run ESLint
run: pnpm lint --quiet --cache --cache-location .eslintcache
- name: Save ESLint cache
if: github.ref_name == github.event.repository.default_branch && steps.eslint-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v6
with:
path: .eslintcache
key: eslint-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'package.json', 'eslint.config.ts') }}-${{ github.sha }}
typecheck:
if: github.repository == 'dream-num/univer' && (github.event_name != 'pull_request' || !github.event.pull_request.draft)
runs-on: ubuntu-latest
timeout-minutes: 15
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: 🧼 Type checking
run: pnpm typecheck