Skip to content

Commit 95594a1

Browse files
authored
chore: simpify test action (#71)
1 parent 418491c commit 95594a1

File tree

1 file changed

+8
-108
lines changed

1 file changed

+8
-108
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -6,113 +6,13 @@ jobs:
66
setup:
77
runs-on: ubuntu-latest
88
steps:
9-
- name: checkout
10-
uses: actions/checkout@v4
11-
12-
- uses: actions/setup-node@v4
13-
with:
14-
node-version: 20
15-
16-
- name: cache package-lock.json
17-
uses: actions/cache@v4
18-
with:
19-
path: package-temp-dir
20-
key: lock-${{ github.sha }}
21-
22-
- name: create package-lock.json
23-
run: npm i --package-lock-only --ignore-scripts
24-
25-
- name: hack for singe file
26-
run: |
27-
if [ ! -d "package-temp-dir" ]; then
28-
mkdir package-temp-dir
29-
fi
30-
cp package-lock.json package-temp-dir
31-
32-
- name: cache node_modules
33-
id: node_modules_cache_id
34-
uses: actions/cache@v4
35-
with:
36-
path: node_modules
37-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
38-
39-
- name: install
40-
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
41-
run: npm ci
42-
43-
lint:
44-
runs-on: ubuntu-latest
45-
steps:
46-
- name: checkout
47-
uses: actions/checkout@v4
48-
49-
- name: restore cache from package-lock.json
50-
uses: actions/cache@v4
51-
with:
52-
path: package-temp-dir
53-
key: lock-${{ github.sha }}
54-
55-
- name: restore cache from node_modules
56-
uses: actions/cache@v4
57-
with:
58-
path: node_modules
59-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
60-
61-
- name: lint
62-
run: npm run lint && npm run type:check
63-
64-
- name: type check
65-
run: npm run type:check
66-
67-
needs: setup
68-
69-
compile:
70-
runs-on: ubuntu-latest
71-
steps:
72-
- name: checkout
73-
uses: actions/checkout@v4
74-
75-
- name: restore cache from package-lock.json
76-
uses: actions/cache@v4
77-
with:
78-
path: package-temp-dir
79-
key: lock-${{ github.sha }}
80-
81-
- name: restore cache from node_modules
82-
uses: actions/cache@v4
83-
with:
84-
path: node_modules
85-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
86-
87-
- name: compile
88-
run: npm run compile
89-
90-
needs: setup
91-
92-
coverage:
93-
runs-on: ubuntu-latest
94-
steps:
95-
- name: checkout
96-
uses: actions/checkout@v4
97-
98-
- name: restore cache from package-lock.json
99-
uses: actions/cache@v4
100-
with:
101-
path: package-temp-dir
102-
key: lock-${{ github.sha }}
103-
104-
- name: restore cache from node_modules
105-
uses: actions/cache@v4
106-
with:
107-
path: node_modules
108-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
109-
110-
- name: coverage
111-
run: npm test -- --coverage
112-
113-
- name: Upload coverage to Codecov
114-
uses: codecov/codecov-action@v4
9+
- uses: actions/checkout@v4
10+
- uses: oven-sh/setup-bun@v2
11+
- run: bun i
12+
- run: bun run lint
13+
- run: bunx tsc --noEmit
14+
- run: bun run compile
15+
- run: npm test -- --coverage
16+
- uses: codecov/codecov-action@v4
11517
with:
11618
token: ${{ secrets.CODECOV_TOKEN }}
117-
118-
needs: setup

0 commit comments

Comments
 (0)