1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 16:23:44 +00:00

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
This commit is contained in:
Addison Beck
2025-09-23 03:33:52 -04:00
committed by GitHub
parent 3ca1395472
commit 18594ade72

41
.github/workflows/nx.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Experimental Nx CI
on:
pull_request:
types: [opened, synchronize]
permissions:
contents: read
jobs:
nx-experiment:
name: Run Nx Affected Tasks
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Get Node Version
id: retrieve-node-version
working-directory: ./
run: |
NODE_NVMRC=$(cat .nvmrc)
NODE_VERSION=${NODE_NVMRC/v/''}
echo "node_version=$NODE_VERSION" >> $GITHUB_OUTPUT
- name: Set up Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
node-version: ${{ env._NODE_VERSION }}
- name: Install dependencies
run: npm ci
- name: Set Nx SHAs for affected detection
uses: nrwl/nx-set-shas@826660b82addbef3abff5fa871492ebad618c9e1 # v4.3.3
- name: Run Nx affected tasks
run: npx nx affected -t build lint test