Skip to content

Commit 18594ad

Browse files
authored
ci: add experimental Nx affected workflow (#16389)
* ci: add experimental Nx affected workflow Adds .github/workflows/nx.yml to run \`nx affected\` on pull requests, testing only changed libraries for build, lint, and test targets. This prevents regressions of the library configuration issues discovered in the systematic Nx library audit and ensures proper library builds in CI. Features: - Uses nrwl/nx-set-shas for accurate affected project detection - Tests build, lint, and test targets - Runs on PR open/synchronize events - Helps catch package.json path bugs before merge * review: get node version from .nvmrc
1 parent 3ca1395 commit 18594ad

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/nx.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Experimental Nx CI
2+
on:
3+
pull_request:
4+
types: [opened, synchronize]
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
nx-experiment:
11+
name: Run Nx Affected Tasks
12+
runs-on: ubuntu-22.04
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Get Node Version
20+
id: retrieve-node-version
21+
working-directory: ./
22+
run: |
23+
NODE_NVMRC=$(cat .nvmrc)
24+
NODE_VERSION=${NODE_NVMRC/v/''}
25+
echo "node_version=$NODE_VERSION" >> $GITHUB_OUTPUT
26+
27+
- name: Set up Node
28+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
29+
with:
30+
cache: 'npm'
31+
cache-dependency-path: '**/package-lock.json'
32+
node-version: ${{ env._NODE_VERSION }}
33+
34+
- name: Install dependencies
35+
run: npm ci
36+
37+
- name: Set Nx SHAs for affected detection
38+
uses: nrwl/nx-set-shas@826660b82addbef3abff5fa871492ebad618c9e1 # v4.3.3
39+
40+
- name: Run Nx affected tasks
41+
run: npx nx affected -t build lint test

0 commit comments

Comments
 (0)