This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (64 loc) · 2.07 KB
/
ci.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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CI: 1
# 7 GiB by default on GitHub, setting to 6 GiB
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
NODE_OPTIONS: --max-old-space-size=6144
FNM_COREPACK_ENABLED: true
FNM_RESOLVE_ENGINES: true
# https://github.com/actions/setup-node/issues/899#issuecomment-1819151595
SKIP_YARN_COREPACK_CHECK: 1
jobs:
ensure:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
- run: |
curl -fsSL https://fnm.vercel.app/install | bash
- run: |
export PATH="/home/runner/.local/share/fnm:$PATH"
echo "/home/runner/.local/share/fnm" >> $GITHUB_PATH
fnm env --json | jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' | xargs -I {} echo "{}" >> $GITHUB_ENV
- run: |
eval "$(fnm env --use-on-cd)"
echo $PATH
fnm use --install-if-missing 18
which node
- uses: pnpm/action-setup@v2
with:
version: 8
- run: pnpm --version
- name: install
run: |
export PATH="/home/runner/.local/share/fnm:$PATH"
eval "$(fnm env --use-on-cd)"
pnpm install --frozen-lockfile --prefer-offline
- id: diff
if: ${{ github.head_ref }}
name: List for difference of the test cases
run: |
git diff HEAD~1 --name-only -- ./tests | sed 's/^tests\///g' | sed 's/.ts$//' | xargs > diff.txt
cat diff.txt
echo "SUITES=$(cat diff.txt)" >> $GITHUB_OUTPUT
- name: Run tests
if: ${{ github.head_ref }}
run: |
export PATH="/home/runner/.local/share/fnm:$PATH"
eval "$(fnm env --use-on-cd)"
bash -r
echo $PATH
which node
pnpm tsx ecosystem-ci.ts run-suites ${{ steps.diff.outputs.SUITES }}