Skip to content

Commit

Permalink
revert: "chore: update hydrogen-alpine version (#6720)"
Browse files Browse the repository at this point in the history
This reverts commit 3531eac.
  • Loading branch information
LinHuiqing committed Sep 25, 2023
1 parent c6c6b61 commit 9a2e496
Show file tree
Hide file tree
Showing 5 changed files with 521 additions and 1,018 deletions.
69 changes: 12 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
- src/**
- package.json
- package-lock.json
install:
runs-on: ubuntu-latest
Expand All @@ -38,14 +37,9 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 14
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Cache Node modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm ci

build:
Expand All @@ -57,18 +51,13 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 14
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
# Load cached node_modules
- name: Cache Node modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run build
env:
NODE_OPTIONS: '--max-old-space-size=4096 --openssl-legacy-provider'
NODE_OPTIONS: '--max-old-space-size=4096'
- name: Upload build files
uses: actions/upload-artifact@v2
if: always()
Expand All @@ -87,15 +76,10 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 14
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
# Load cached node_modules
- name: Cache Node modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run test:frontend

frontend_lint:
Expand All @@ -107,33 +91,17 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 14
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
# Load cached node_modules
- name: Cache Node modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run lint:frontend

backend_test:
needs: [changes, install, build]
if: ${{ needs.changes.outputs.backend == 'true' }}
runs-on: ubuntu-latest
steps:
# prevent CI from failing when worker runs out of memory
# https://github.com/actions/runner-images/discussions/7188#discussioncomment-6750749
- name: Increase swapfile
run: |
df -h
sudo swapoff -a
sudo fallocate -l 15G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
if: always()
Expand All @@ -142,19 +110,11 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 14
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
# Load cached node_modules
- name: Cache Node modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm ci --prefix serverless/virus-scanner
- run: npm ci && npm ci --prefix serverless/virus-scanner
- run: npm run test:backend
env:
NODE_OPTIONS: '--max-old-space-size=4096'
- name: Coveralls
uses: coverallsapp/github-action@master
with:
Expand All @@ -169,14 +129,9 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 14
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
# Load cached node_modules
- name: Cache Node modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run lint-ci
- run: npm_config_mode=yes npx lockfile-lint --type npm --path package.json --validate-https --allowed-hosts npm
4 changes: 2 additions & 2 deletions Dockerfile.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:hydrogen-alpine3.18
FROM node:hydrogen-alpine3.16
LABEL maintainer=FormSG<[email protected]>

WORKDIR /opt/formsg
Expand Down Expand Up @@ -28,7 +28,7 @@ RUN apk update && apk upgrade && \
# that is guaranteed to work. Upgrades must be done in lockstep.
# https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#running-on-alpine
# https://www.npmjs.com/package/puppeteer-core?activeTab=versions for corresponding versions
chromium=115.0.5790.170-r0 \
chromium=102.0.5005.182-r0 \
nss \
freetype \
freetype-dev \
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.production
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM node:hydrogen-alpine3.18 as build
FROM node:hydrogen-alpine3.16 as build

# node-modules-builder stage installs/compiles the node_modules folder
# Python version must be specified starting in alpine3.12
Expand Down Expand Up @@ -60,7 +60,7 @@ RUN --mount=type=secret,id=dd_api_key \
RUN npm prune --production --legacy-peer-deps

# This stage builds the final container
FROM node:hydrogen-alpine3.18
FROM node:hydrogen-alpine3.16
LABEL maintainer=FormSG<[email protected]>
WORKDIR /opt/formsg

Expand All @@ -81,7 +81,7 @@ RUN mv /opt/formsg/dist/backend/shared /opt/formsg/
# https://www.npmjs.com/package/puppeteer-core?activeTab=versions for corresponding versions

RUN apk add --no-cache \
chromium=115.0.5790.170-r0 \
chromium=102.0.5005.182-r0 \
nss \
freetype \
freetype-dev \
Expand Down
Loading

0 comments on commit 9a2e496

Please sign in to comment.