Skip to content

Commit b28ba81

Browse files
committed
Lock down yarn & JS dep versions to ensure reproducibility
1 parent 9d40bde commit b28ba81

5 files changed

Lines changed: 26 additions & 16 deletions

File tree

.github/workflows/deployment-checks.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,14 @@ jobs:
4848
cp config/secrets.github.yml config/secrets.yml
4949
cp config/ingestion.example.yml config/ingestion.yml
5050
bundle exec rake db:setup
51-
- run: yarn install
52-
name: Install JS dependencies
53-
- run: bundle exec rake assets:precompile
54-
name: Run asset compilation
55-
- run: bundle exec whenever --update-crontab --set environment="$ENV"
56-
name: Run whenever update
51+
- name: Set up Node
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: '20.x'
55+
cache: 'yarn'
56+
- name: Install JS dependencies
57+
run: yarn install --frozen-lockfile --non-interactive
58+
- name: Run asset compilation
59+
run: bundle exec rake assets:precompile
60+
- name: Run whenever update
61+
run: bundle exec whenever --update-crontab --set environment="$ENV"

.github/workflows/test.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ jobs:
5353
cp config/secrets.github.yml config/secrets.yml
5454
cp config/ingestion.example.yml config/ingestion.yml
5555
bundle exec rake db:test:prepare
56-
- run: yarn install
57-
name: Install JS dependencies
58-
- run: bundle exec rails test
59-
name: Run tests
56+
- name: Set up Node
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: '20.x'
60+
cache: 'yarn'
61+
- name: Install JS dependencies
62+
run: yarn install --frozen-lockfile --non-interactive
63+
- name: Run tests
64+
run: bundle exec rails test

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN apt-get update \
1212
&& apt-get clean
1313

1414
# install yarn to manage JS dependencies
15-
RUN npm install --global yarn
15+
RUN npm install --global yarn@1.22.22
1616

1717
# install supercronic - a cron alternative
1818
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-amd64 \
@@ -47,7 +47,7 @@ RUN bundle check || bundle install
4747
COPY package.json yarn.lock ./
4848

4949
# install js dependencies
50-
RUN yarn install
50+
RUN yarn install --frozen-lockfile --non-interactive
5151

5252
# copy code
5353
COPY . .

docs/install.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ TeSS uses yarn to manage JS dependencies.
7474

7575
Install it using npm:
7676

77-
npm install --global yarn
77+
npm install --global yarn@1.22.22
7878

7979
and install JS dependencies using (from the app's root directory):
8080

81-
yarn install
81+
yarn install --frozen-lockfile
8282

8383
## PostgreSQL
8484

docs/production.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ _Note: Ensure you have started Solr before running this command!_
188188

189189
Install yarn globally via npm:
190190

191-
npm install --global yarn
191+
npm install --global yarn@1.22.22
192192

193193
Install JS dependencies:
194194

195-
yarn install
195+
yarn install --frozen-lockfile --non-interactive
196196

197197
## Compile assets
198198

0 commit comments

Comments
 (0)