Skip to content

Commit

Permalink
Add GitHub Actions Workflow for Web Tests (#8753)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzuodong authored Sep 25, 2024
1 parent b0927c3 commit 2ef8b18
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/web-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Web Tests

on:
pull_request:
branches:
- main
paths:
- web/**

concurrency:
group: web-tests-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
test:
name: Web Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./web

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: web/**

- name: Setup Node.js
uses: actions/setup-node@v4
if: steps.changed-files.outputs.any_changed == 'true'
with:
node-version: 20
cache: yarn
cache-dependency-path: ./web/package.json

- name: Install dependencies
if: steps.changed-files.outputs.any_changed == 'true'
run: yarn install --frozen-lockfile

- name: Run tests
if: steps.changed-files.outputs.any_changed == 'true'
run: yarn test

0 comments on commit 2ef8b18

Please sign in to comment.