Skip to content

Commit 3c9e6dc

Browse files
authored
ci: use setup-vp for JavaScript tooling (#3245)
* ci: use setup-vp for JavaScript tooling * fix(ci): run JavaScript commands through Vite+ setup-vp exposes the Vite+ CLI but not the underlying pnpm binary to subsequent workflow steps. Use Vite+ to run scripts and binaries, and validate Renovate without a global package-manager install.
1 parent 87d59db commit 3c9e6dc

6 files changed

Lines changed: 41 additions & 60 deletions

File tree

‎.github/actions/setup-node/action.yml‎

Lines changed: 0 additions & 31 deletions
This file was deleted.

‎.github/workflows/build.yml‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ jobs:
2727
include:
2828
- os: macos-latest
2929
platform: macOS
30-
package-cmd: pnpm package:macos --publish=never -c.mac.identity=null
30+
package-cmd: vp run package:macos -- --publish=never -c.mac.identity=null
3131
cleanup-path: dist/mac-universal
3232
artifact-name: Gitify-dist-mac
3333
- os: windows-latest
3434
platform: Windows
35-
package-cmd: pnpm package:win --publish=never
35+
package-cmd: vp run package:win -- --publish=never
3636
cleanup-path: dist/win-unpacked
3737
artifact-name: Gitify-dist-win
3838
- os: ubuntu-latest
3939
platform: Linux
40-
package-cmd: pnpm package:linux --publish=never
40+
package-cmd: vp run package:linux -- --publish=never
4141
cleanup-path: dist/linux-unpacked
4242
artifact-name: Gitify-dist-linux
4343
runs-on: ${{ matrix.os }}
@@ -48,11 +48,13 @@ jobs:
4848
with:
4949
persist-credentials: false
5050

51-
- name: Setup Node.js
52-
uses: ./.github/actions/setup-node
51+
- name: Setup Vite+
52+
uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
53+
with:
54+
cache: true
5355

5456
- name: Build application
55-
run: pnpm build
57+
run: vp run build
5658

5759
- name: Package for ${{ matrix.platform }}
5860
run: ${{ matrix.package-cmd }}

‎.github/workflows/lint.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ jobs:
1818
with:
1919
persist-credentials: false
2020

21-
- name: Setup Node.js
22-
uses: ./.github/actions/setup-node
21+
- name: Setup Vite+
22+
uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
23+
with:
24+
cache: true
2325

2426
- name: Run lint and format checks
25-
run: pnpm check
27+
run: vp run check
2628

2729
lint-actions:
2830
name: Lint GitHub Actions [actionlint]

‎.github/workflows/publish.yml‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ jobs:
4545
include:
4646
- os: macos-latest
4747
platform: macOS
48-
package-cmd: pnpm package:macos --publish onTagOrDraft
48+
package-cmd: vp run package:macos -- --publish onTagOrDraft
4949
artifact-name: Gitify-release-mac
5050
use-apple-notarization: true
5151
- os: windows-latest
5252
platform: Windows
53-
package-cmd: pnpm package:win --publish onTagOrDraft
53+
package-cmd: vp run package:win -- --publish onTagOrDraft
5454
artifact-name: Gitify-release-win
5555
use-apple-notarization: false
5656
- os: ubuntu-latest
5757
platform: Linux
58-
package-cmd: pnpm package:linux --publish onTagOrDraft
58+
package-cmd: vp run package:linux -- --publish onTagOrDraft
5959
artifact-name: Gitify-release-linux
6060
use-apple-notarization: false
6161
runs-on: ${{ matrix.os }}
@@ -66,11 +66,13 @@ jobs:
6666
with:
6767
persist-credentials: false
6868

69-
- name: Setup Node.js
70-
uses: ./.github/actions/setup-node
69+
- name: Setup Vite+
70+
uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
71+
with:
72+
cache: true
7173

7274
- name: Build application
73-
run: pnpm build
75+
run: vp run build
7476
env:
7577
OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }}
7678

‎.github/workflows/renovate.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ jobs:
2323
persist-credentials: false
2424
sparse-checkout: |
2525
renovate.json
26+
package.json
27+
pnpm-lock.yaml
2628
.github
2729
28-
- uses: ./.github/actions/setup-node
30+
- uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
2931
with:
32+
cache: true
3033
run-install: 'false'
3134

32-
- name: Install Renovate
33-
run: pnpm install --global renovate
34-
3535
- name: Validate Renovate config
36-
run: renovate-config-validator
36+
run: vp dlx --package renovate renovate-config-validator

‎.github/workflows/test.yml‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ jobs:
2121
with:
2222
persist-credentials: false
2323

24-
- name: Setup Node.js
25-
uses: ./.github/actions/setup-node
24+
- name: Setup Vite+
25+
uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
26+
with:
27+
cache: true
2628

2729
- name: Check TypeScript
28-
run: pnpm tsc --noEmit
30+
run: vp exec tsc --noEmit
2931

3032
- name: Run tests with coverage
31-
run: pnpm test
33+
run: vp run test
3234

3335
- name: Archive code coverage results
3436
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
@@ -59,15 +61,17 @@ jobs:
5961
with:
6062
persist-credentials: false
6163

62-
- name: Setup Node.js
63-
uses: ./.github/actions/setup-node
64+
- name: Setup Vite+
65+
uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
66+
with:
67+
cache: true
6468

6569
- name: Run visual regression tests
6670
# The job already runs in the pinned image, so the script runs vitest
6771
# directly instead of starting another container.
6872
env:
6973
GITIFY_VISUAL_IN_CONTAINER: '1'
70-
run: pnpm test:visual
74+
run: vp run test:visual
7175

7276
# Vitest writes the actual and diff images here; the reference stays in
7377
# __screenshots__. Download this to see what changed.
@@ -95,8 +99,10 @@ jobs:
9599
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
96100
persist-credentials: false
97101

98-
- name: Setup Node.js
99-
uses: ./.github/actions/setup-node
102+
- name: Setup Vite+
103+
uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
104+
with:
105+
cache: true
100106

101107
- name: Download a single artifact
102108
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1

0 commit comments

Comments
 (0)