Merge pull request #258 from hankei6km/dependabot/npm_and_yarn/vscode… #728
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: | |
pull_request: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- '!v*' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
# https://docs.github.com/ja/free-pro-team@latest/actions/guides/caching-dependencies-to-speed-up-workflows | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm キャッシュファイルは Linux/macOS の「~/.npm」に保存される | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
# 今回は devcontainer-ci は使わない予定。 | |
- name: Install packages(to run xvfb) | |
run: | | |
sudo apt update -y | |
sudo apt install -y --no-install-recommends xauth libgtk-3-0 xvfb | |
- name: Install modules | |
run: | | |
npm ci | |
npx playwright install --with-deps | |
- name: Run tests | |
run: | | |
npm run lint:type-check | |
npm run test |