Skip to content

Commit 6b5057b

Browse files
Point CI at my-app instead of the create-react-app monorepo (#4)
Removes the inherited upstream create-react-app CI (build-and-test.yml, e2e-base.yml, lint.yml), which exercised packages/ through lerna, verdaccio and puppeteer on Node 16 and could not pass after commit dc079b1 replaced the monorepo root package.json with a create-react-app app's. Retargets node.js.yml at my-app, running install, lint and build on Node 20.x and 22.x. The 18.x leg is dropped because Vite 8 requires ^20.19.0 || >=22.12.0. This also gives my-app its first pull request coverage; deploy-my-app.yml only runs on main, so its code was previously never built or linted before reaching the default branch.
2 parents 897eff0 + f07c185 commit 6b5057b

4 files changed

Lines changed: 30 additions & 149 deletions

File tree

‎.github/workflows/build-and-test.yml‎

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

‎.github/workflows/e2e-base.yml‎

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

‎.github/workflows/lint.yml‎

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

‎.github/workflows/node.js.yml‎

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,44 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3-
1+
# CI for my-app, the app this repo actively maintains.
2+
#
3+
# This previously ran npm ci / build / test at the repo root. That could not
4+
# pass: the root package.json describes a create-react-app app with no src/ or
5+
# public/ directory, so react-scripts build always failed looking for
6+
# public/index.html.
47
name: Node.js CI
58

69
on:
710
push:
8-
branches: [ "main" ]
11+
branches: ['main']
912
pull_request:
10-
branches: [ "main" ]
13+
branches: ['main']
1114

1215
jobs:
1316
build:
14-
1517
runs-on: ubuntu-latest
18+
defaults:
19+
run:
20+
working-directory: my-app
1621

1722
strategy:
23+
fail-fast: false
1824
matrix:
19-
node-version: [18.x, 20.x, 22.x]
20-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
25+
# Vite 8 requires ^20.19.0 || >=22.12.0, so 18.x is not supported.
26+
node-version: [20.x, 22.x]
2127

2228
steps:
23-
- uses: actions/checkout@v4
24-
- name: Use Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v4
26-
with:
27-
node-version: ${{ matrix.node-version }}
28-
cache: 'npm'
29-
- run: npm ci
30-
- run: npm run build --if-present
31-
- run: npm test
29+
- uses: actions/checkout@v4
30+
31+
- uses: actions/setup-node@v4
32+
with:
33+
node-version: ${{ matrix.node-version }}
34+
cache: npm
35+
cache-dependency-path: my-app/package-lock.json
36+
37+
- name: Install
38+
run: npm ci
39+
40+
- name: Lint
41+
run: npm run lint
42+
43+
- name: Build
44+
run: npm run build

0 commit comments

Comments
 (0)