Skip to content

Commit

Permalink
Replace npm with yarn for faster frontend build.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniessink committed Nov 8, 2024
1 parent 2e0befa commit 957cc2e
Show file tree
Hide file tree
Showing 14 changed files with 12,484 additions and 27,026 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- checkout
- run: |
cd components/frontend
npm install --ignore-scripts
yarn install --ignore-scripts
ci/unittest.sh
ci/quality.sh
Expand All @@ -64,7 +64,7 @@ jobs:
- run: |
pip install uv
cd docs
npm install --ignore-scripts
yarn install --ignore-scripts
uv venv
ci/pip-install.sh
ci/unittest.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
cd docs
uv venv
ci/pip-install.sh
npm install --ignore-scripts
yarn install --ignore-scripts
ci/unittest.sh
ci/quality.sh
6 changes: 3 additions & 3 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
- name: yarn install, build, and test
run: |
cd components/frontend
npm ci
npm run --ignore-scripts build --if-present
yarn install --ignore-scripts
yarn run --ignore-scripts build
ci/unittest.sh
ci/quality.sh
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ jobs:
if: env.SONAR_TOKEN != null
working-directory: components/frontend
run: |
npm install --ignore-scripts
npm run --ignore-scripts build --if-present
npm test -- --coverage
yarn install --ignore-scripts
yarn run --ignore-scripts build
yarn run test --coverage
env:
CI: true
- name: Create packages
Expand Down
6 changes: 3 additions & 3 deletions ci/update-indirect-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ set -e
(cd components/api_server; ci/pip-compile.sh; ci/pip-install.sh) &
(cd components/collector; ci/pip-compile.sh; ci/pip-install.sh) &
(cd components/notifier; ci/pip-compile.sh; ci/pip-install.sh) &
(cd components/frontend; rm package-lock.json; npm install --ignore-scripts) &
(cd components/renderer; rm package-lock.json; npm install --ignore-scripts) &
(cd docs; rm package-lock.json; npm install --ignore-scripts) &
(cd components/frontend; rm package-lock.json; yarn install --ignore-scripts) &
(cd components/renderer; rm package-lock.json; yarn install --ignore-scripts) &
(cd docs; rm package-lock.json; yarn install --ignore-scripts) &
(cd docs; ci/pip-compile.sh; ci/pip-install.sh) &
(cd release; ci/pip-compile.sh; ci/pip-install.sh) &
(cd tests/application_tests; ci/pip-compile.sh; ci/pip-install.sh) &
Expand Down
10 changes: 5 additions & 5 deletions components/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ LABEL maintainer="Quality-time team <[email protected]>"
LABEL description="Quality-time frontend"

WORKDIR /home/frontend
COPY package*.json /home/frontend
COPY package.json /home/frontend
COPY yarn.lock /home/frontend
COPY public /home/frontend/public
COPY src /home/frontend/src
COPY healthcheck.js /home/frontend
COPY .env /home/frontend
RUN npm install --ignore-scripts -g [email protected] && \
npm install --ignore-scripts && \
npm install --ignore-scripts -g [email protected] && \
npm run --ignore-scripts build && \
RUN yarn install --ignore-scripts && \

Check failure on line 13 in components/frontend/Dockerfile

View workflow job for this annotation

GitHub Actions / build (frontend)

DL3060 info: `yarn cache clean` missing after `yarn install` was run.
yarn global add --ignore-scripts [email protected] && \
yarn run --ignore-scripts build && \
adduser frontend --disabled-password
USER frontend

Expand Down
2 changes: 1 addition & 1 deletion components/frontend/ci/unittest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
PATH="$PATH:../../ci"
source unittest-base.sh

run npm test
run yarn run test
Loading

0 comments on commit 957cc2e

Please sign in to comment.