Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node 20対応 #1467

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
- 5432:5432

steps:
- uses: actions/checkout@v3.3.0
- uses: actions/checkout@v4.2.0

- name: Cache dependencies
uses: Swatinem/rust-cache@v2.2.0
uses: Swatinem/rust-cache@v2.7.3
with:
workspaces: atcoder-problems-backend -> target

Expand Down Expand Up @@ -70,31 +70,36 @@ jobs:
working-directory: ./atcoder-problems-frontend

steps:
- uses: actions/checkout@v3.3.0
- uses: actions/checkout@v4.2.0

- name: Use Node.js
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v4.0.4
with:
node-version: 16
node-version: 20

- name: Cache node_modules
uses: actions/cache@v3.2.3
- name: Cache dependencies
uses: actions/cache@v4.0.2
with:
path: |
~/.cache/Cypress
./atcoder-problems-frontend/node_modules
key: ${{ runner.os }}-cargo-${{ hashFiles('atcoder-problems-frontend/yarn.lock') }}
atcoder-problems-frontend/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('atcoder-problems-frontend/yarn.lock') }}

- name: Install dependencies
run: yarn

- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1.2.0
uses: peaceiris/actions-mdbook@v2.0.0
with:
mdbook-version: "latest"

# Node 17でOpenSSLがデフォルトでMD4ハッシュを提供しなくなり、
# これに依存していたwebpackに依存するreact-scripts 4.x系でのビルドができなくなってしまった。
# --openssl-legacy-providerをオプションとして渡すことで、Node 17以降でもビルドができる。
# react-scripts 4.x系から移行したら、このオプションは不要になる。
- name: build
run: yarn build
run: env NODE_OPTIONS=--openssl-legacy-provider yarn build

- name: test
run: yarn test
- name: lint
Expand Down
8 changes: 7 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@ services:
command: /bin/sh -c "cargo watch -s 'cargo run --bin run_server'"

frontend-development:
image: node:16
image: node:20
ports:
- "3000:3000"
environment:
# Node 17でOpenSSLがデフォルトでMD4ハッシュを提供しなくなり、
# これに依存していたwebpackに依存するreact-scripts 4.x系でのビルドができなくなってしまった。
# --openssl-legacy-providerをオプションとして渡すことで、Node 17以降でもビルドができる。
# react-scripts 4.x系から移行したら、このオプションは不要になる。
NODE_OPTIONS: --openssl-legacy-provider
volumes:
- ./:/app
- node_modules:/app/atcoder-problems-frontend/node_modules
Expand Down
Loading