Skip to content

Commit

Permalink
(一部を除き)CIのNode 20対応
Browse files Browse the repository at this point in the history
Node 16は2023年9月11にEOLとなり、GitHub ActionsではNode 20の利用が推奨されている。

peaceiris/actions-mdbookはまだ対応したバージョンがリリースされていないため、対応PR
(peaceiris/actions-mdbook#500

https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/
  • Loading branch information
hotate29 committed Mar 5, 2024
1 parent 37e6478 commit 1084904
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUST_TEST_THREADS: 1
CARGO_PROFILE_TEST_DEBUG: 0
RUST_TEST_THREADS: 1
SQL_URL: postgres://db_user:db_pass@localhost:5432/test_db

jobs:
Expand Down Expand Up @@ -37,10 +37,10 @@ jobs:
- 5432:5432

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

- 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.1.1

- name: Use Node.js
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v4.0.2
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.1
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

# Node 20対応がリリースされておらず、https://github.com/peaceiris/actions-mdbook/pull/500 のマージ待ち
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1.2.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: export NODE_OPTIONS=--openssl-legacy-provider && yarn build
- name: test
run: yarn test
- name: lint
Expand Down

0 comments on commit 1084904

Please sign in to comment.