From 415414dce0b643cf6233984bad034e75705ea0eb Mon Sep 17 00:00:00 2001 From: hotate29 <44938840+hotate29@users.noreply.github.com> Date: Sun, 3 Mar 2024 00:51:48 +0900 Subject: [PATCH 1/2] =?UTF-8?q?CI=E3=81=AENode=2020=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Node 16は2023年9月11にEOLとなり、GitHub ActionsではNode 20の利用が推奨されている。 https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/ --- .github/workflows/ci.yml | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7256a81b3..0ba992811 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 From 704b3ed86019c156b2a465b05dbf0fd66c54423e Mon Sep 17 00:00:00 2001 From: hotate29 <44938840+hotate29@users.noreply.github.com> Date: Wed, 2 Oct 2024 23:47:27 +0900 Subject: [PATCH 2/2] =?UTF-8?q?frontend-development=E3=81=AEimage=E3=82=92?= =?UTF-8?q?node:20=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8b0f68b31..81bc9da73 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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