Skip to content

Commit da1789a

Browse files
committed
.github/workflows/build.yml: use npm
Use npm instead of yarn in GitHub Actions.
1 parent c6f984b commit da1789a

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

.github/workflows/build.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -69,39 +69,39 @@ jobs:
6969
fi
7070
google-chrome --version
7171
72-
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
73-
- name: Get Yarn cache directory
74-
id: yarn-cache-dir-path
75-
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
76-
- name: Cache Yarn dependencies
72+
# https://github.com/actions/cache/blob/main/examples.md#node---npm
73+
- name: Get NPM cache directory
74+
id: npm-cache-dir
75+
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
76+
- name: Cache NPM dependencies
7777
uses: actions/cache@v4
7878
with:
79-
# Cache entire Yarn cache directory (see previous step)
80-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
81-
# Cache key is hash of yarn.lock. Therefore changes to yarn.lock will invalidate cache
82-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
83-
restore-keys: ${{ runner.os }}-yarn-
79+
# Cache entire NPM cache directory (see previous step)
80+
path: ${{ steps.npm-cache-dir.outputs.dir }}
81+
# Cache key is hash of package-lock.json. Therefore changes to package-lock.json will invalidate cache
82+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
83+
restore-keys: ${{ runner.os }}-npm-
8484

85-
- name: Install Yarn dependencies
86-
run: yarn install --frozen-lockfile
85+
- name: Install NPM dependencies
86+
run: npm clean-install
8787

8888
- name: Build lint plugins
89-
run: yarn run build:lint
89+
run: npm run build:lint
9090

9191
- name: Run lint plugin tests
92-
run: yarn run test:lint:nobuild
92+
run: npm run test:lint:nobuild
9393

9494
- name: Run lint
95-
run: yarn run lint:nobuild --quiet
95+
run: npm run lint:nobuild -- --quiet
9696

9797
- name: Check for circular dependencies
98-
run: yarn run check-circ-deps
98+
run: npm run check-circ-deps
9999

100100
- name: Run build
101-
run: yarn run build:prod
101+
run: npm run build:prod
102102

103103
- name: Run specs (unit tests)
104-
run: yarn run test:headless
104+
run: npm run test:headless
105105

106106
# Upload code coverage report to artifact (for one version of Node only),
107107
# so that it can be shared with the 'codecov' job (see below)
@@ -131,7 +131,7 @@ jobs:
131131
# Run tests in Chrome, headless mode (default)
132132
browser: chrome
133133
# Start app before running tests (will be stopped automatically after tests finish)
134-
start: yarn run serve:ssr
134+
start: npm run serve:ssr
135135
# Wait for backend & frontend to be available
136136
# NOTE: We use the 'sites' REST endpoint to also ensure the database is ready
137137
wait-on: http://127.0.0.1:8080/server/api/core/sites, http://127.0.0.1:4000
@@ -167,7 +167,7 @@ jobs:
167167
# Start up the app with SSR enabled (run in background)
168168
- name: Start app in SSR (server-side rendering) mode
169169
run: |
170-
nohup yarn run serve:ssr &
170+
nohup npm run serve:ssr &
171171
printf 'Waiting for app to start'
172172
until curl --output /dev/null --silent --head --fail http://127.0.0.1:4000/home; do
173173
printf '.'

0 commit comments

Comments
 (0)