Skip to content

Commit 67d92b7

Browse files
committed
cleaner actions
1 parent ed74a9b commit 67d92b7

File tree

3 files changed

+57
-16
lines changed

3 files changed

+57
-16
lines changed

.github/workflows/pr-tests.yml

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,37 @@ on:
44
pull_request:
55
branches: [main]
66
types: [opened, synchronize, reopened]
7-
# Also run on pushes to main for consistency
8-
push:
9-
branches: [main]
107

118
# Cancel in-progress runs for the same PR
129
concurrency:
1310
group: ${{ github.workflow }}-${{ github.ref }}
1411
cancel-in-progress: true
1512

13+
env:
14+
NODE_VERSION: ${{ vars.NODE_VERSION }}
15+
PNPM_VERSION: ${{ vars.PNPM_VERSION }}
16+
1617
jobs:
17-
test:
18-
name: Test Suite
18+
# Code quality checks (fast, no build required)
19+
quality:
20+
name: Code Quality
1921
runs-on: ubuntu-latest
20-
timeout-minutes: 15
21-
22+
timeout-minutes: 10
2223
steps:
2324
- name: Checkout code
2425
uses: actions/checkout@v4
2526
with:
26-
# Fetch full history for Nx affected commands (optional optimization)
2727
fetch-depth: 0
2828

2929
- name: Setup Node.js
3030
uses: actions/setup-node@v4
3131
with:
32-
node-version: ${{ vars.NODE_VERSION }}
33-
registry-url: "https://registry.npmjs.org"
32+
node-version: ${{ env.NODE_VERSION }}
3433

3534
- name: Setup pnpm
3635
uses: pnpm/action-setup@v4
3736
with:
38-
version: "10.6.3"
37+
version: ${{ env.PNPM_VERSION }}
3938
run_install: false
4039

4140
- name: Get pnpm store directory
@@ -63,6 +62,44 @@ jobs:
6362
- name: Check formatting
6463
run: pnpm format:check
6564

65+
# Build and test (slower, runs in parallel with quality)
66+
test:
67+
name: Build & Test
68+
runs-on: ubuntu-latest
69+
timeout-minutes: 15
70+
steps:
71+
- name: Checkout code
72+
uses: actions/checkout@v4
73+
with:
74+
fetch-depth: 0
75+
76+
- name: Setup Node.js
77+
uses: actions/setup-node@v4
78+
with:
79+
node-version: ${{ env.NODE_VERSION }}
80+
81+
- name: Setup pnpm
82+
uses: pnpm/action-setup@v4
83+
with:
84+
version: ${{ env.PNPM_VERSION }}
85+
run_install: false
86+
87+
- name: Get pnpm store directory
88+
shell: bash
89+
run: |
90+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
91+
92+
- name: Setup pnpm cache
93+
uses: actions/cache@v4
94+
with:
95+
path: ${{ env.STORE_PATH }}
96+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
97+
restore-keys: |
98+
${{ runner.os }}-pnpm-store-
99+
100+
- name: Install dependencies
101+
run: pnpm install --frozen-lockfile
102+
66103
- name: Build packages
67104
run: pnpm build
68105

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
# Prevent multiple releases from running at the same time
1010
concurrency: ${{ github.workflow }}-${{ github.ref }}
1111

12+
env:
13+
NODE_VERSION: ${{ vars.NODE_VERSION }}
14+
PNPM_VERSION: ${{ vars.PNPM_VERSION }}
15+
1216
jobs:
1317
release:
1418
name: Release
@@ -31,13 +35,13 @@ jobs:
3135
- name: Setup Node.js
3236
uses: actions/setup-node@v4
3337
with:
34-
node-version: ${{ vars.NODE_VERSION }}
38+
node-version: ${{ env.NODE_VERSION }}
3539
registry-url: "https://registry.npmjs.org"
3640

3741
- name: Setup pnpm
3842
uses: pnpm/action-setup@v4
3943
with:
40-
version: "10.6.3"
44+
version: ${{ env.PNPM_VERSION }}
4145
run_install: false
4246

4347
- name: Get pnpm store directory

.github/workflows/snapshot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ on:
3232
run-name: "Publishing ${{ inputs.snapshot_tag }} for ${{ inputs.packages }} to ${{ inputs.environment }} by @${{ github.actor }}"
3333

3434
env:
35-
NODE_VERSION: 22.12.0
36-
PNPM_VERSION: 10.7.1
35+
NODE_VERSION: ${{ vars.NODE_VERSION }}
36+
PNPM_VERSION: ${{ vars.PNPM_VERSION }}
3737
IS_CI: true
3838

3939
permissions:
@@ -52,7 +52,7 @@ jobs:
5252
fetch-depth: 0
5353

5454
# Setup Node.js and pnpm
55-
- uses: pnpm/action-setup@v3
55+
- uses: pnpm/action-setup@v4
5656
with:
5757
version: ${{ env.PNPM_VERSION }}
5858
run_install: false

0 commit comments

Comments
 (0)