Skip to content

Commit 4e58b25

Browse files
committed
ci: fix placing the built artifacts
1 parent 697fc17 commit 4e58b25

File tree

3 files changed

+40
-22
lines changed

3 files changed

+40
-22
lines changed

.github/workflows/CI.yml

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,13 @@ jobs:
4848
with:
4949
version: ${{ matrix.pnpm }}
5050

51-
- name: Install and build
51+
- name: Install
5252
run: |
5353
pnpm install
54+
55+
- name: Build
56+
run: |
57+
pnpm build
5458
pnpm build.docker_tests
5559
5660
- name: Upload Dist
@@ -62,8 +66,8 @@ jobs:
6266
./dev/docker/__tests__/
6367
retention-days: 1
6468

65-
Build_Executable:
66-
name: Build_Executable-${{ matrix.os }}
69+
BuildExecutable:
70+
name: Build-Executable-${{ matrix.os }}
6771
needs: [Build]
6872
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
6973
runs-on: ${{ matrix.os }}
@@ -85,10 +89,6 @@ jobs:
8589
uses: actions/download-artifact@v3
8690
with:
8791
name: dist
88-
- name: Place Artifacts
89-
shell: bash
90-
run: |
91-
mv -v artifact/* ./
9292

9393
- name: Setup Node
9494
uses: actions/setup-node@v3
@@ -100,6 +100,21 @@ jobs:
100100
with:
101101
version: ${{ matrix.pnpm }}
102102

103+
- name: Cache node_modules
104+
uses: actions/cache@v3
105+
with:
106+
path: |
107+
~/.pnpm-store
108+
D:\.pnpm-store
109+
./node_modules
110+
key: "setupcpp-node_modules-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
111+
restore-keys: |
112+
"setupcpp-node_modules-cache-OS:${{ matrix.os }}-"
113+
114+
- name: Install
115+
run: |
116+
pnpm install
117+
103118
# Create self-contained executable that bundles Nodejs
104119
- name: Create Executable
105120
run: |
@@ -114,7 +129,7 @@ jobs:
114129
retention-days: 1
115130

116131
Test:
117-
name: ${{ matrix.os }}
132+
name: Test-${{ matrix.os }}
118133
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') || !contains(github.event.head_commit.message, '[skip test]') }}
119134
needs: [Build]
120135
runs-on: ${{ matrix.os }}
@@ -141,10 +156,6 @@ jobs:
141156
uses: actions/download-artifact@v3
142157
with:
143158
name: dist
144-
- name: Place Dist
145-
shell: bash
146-
run: |
147-
mv -v artifact/* ./
148159

149160
- name: Setup Node
150161
uses: actions/setup-node@v3
@@ -156,13 +167,24 @@ jobs:
156167
with:
157168
version: ${{ matrix.pnpm }}
158169

159-
# - name: Setup SSH debugging session
160-
# uses: mxschmitt/action-tmate@v3
170+
- name: Cache node_modules
171+
uses: actions/cache@v3
172+
with:
173+
path: |
174+
~/.pnpm-store
175+
D:\.pnpm-store
176+
./node_modules
177+
key: "setupcpp-node_modules-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
178+
restore-keys: |
179+
"setupcpp-node_modules-cache-OS:${{ matrix.os }}-"
161180
162181
- name: Install
163182
run: |
164183
pnpm install
165184
185+
# - name: Setup SSH debugging session
186+
# uses: mxschmitt/action-tmate@v3
187+
166188
- name: Test
167189
run: |
168190
pnpm run test
@@ -184,7 +206,7 @@ jobs:
184206
node ./dist/actions/setup-cpp.js --help
185207
186208
Docker:
187-
name: ${{ matrix.container }}
209+
name: Test-${{ matrix.container }}
188210
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip test]') }}
189211
needs: [Build]
190212
runs-on: ${{ matrix.os }}
@@ -213,10 +235,6 @@ jobs:
213235
uses: actions/download-artifact@v3
214236
with:
215237
name: dist
216-
- name: Place Dist
217-
shell: bash
218-
run: |
219-
mv -v artifact/* ./
220238

221239
- name: Build
222240
id: docker_build
@@ -226,7 +244,7 @@ jobs:
226244
227245
Release:
228246
if: startsWith(github.ref, 'refs/tags/')
229-
needs: [Build, Build_Executable, Test, Docker]
247+
needs: [Build, BuildExecutable, Test, Docker]
230248
runs-on: ubuntu-22.04
231249
steps:
232250
- name: Download All Artifacts

jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Config } from "jest"
33
const jestConfig: Config = {
44
testMatch: ["**/*.test.ts"],
55
testEnvironment: "node",
6-
extensionsToTreatAsEsm: [".ts", ".tsx", ".js", ".jsx"],
6+
extensionsToTreatAsEsm: [".ts", ".tsx", ".jsx"],
77
transformIgnorePatterns: [], // transform node_modules
88
transform: {
99
"^.+\\.(t|j)sx?$": "@swc/jest",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"test.lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/",
5757
"test.lint.prettier": "prettier . --check",
5858
"test.unit": "jest --runInBand",
59-
"build.docker_tests": "pnpm build && node ./dev/docker/__tests__/generate-docker-tests.mjs",
59+
"build.docker_tests": "node ./dev/docker/__tests__/generate-docker-tests.mjs",
6060
"build.docker.arch": "pnpm build.docker_tests && docker build -f ./dev/docker/__tests__/arch.dockerfile -t setup-cpp:arch .",
6161
"build.docker.fedora": "pnpm build.docker_tests && docker build -f ./dev/docker/__tests__/fedora.dockerfile -t setup-cpp:fedora .",
6262
"build.docker.ubuntu": "pnpm build.docker_tests && docker build -f ./dev/docker/__tests__/ubuntu.dockerfile -t setup-cpp:ubuntu .",

0 commit comments

Comments
 (0)