From 92cb61cceb78b43966d374370fcdb8c721b741f0 Mon Sep 17 00:00:00 2001 From: Arabasta Date: Sun, 14 Jul 2024 00:01:56 +0800 Subject: [PATCH] ci: Add CI workflow for react frontend --- .github/workflows/ci_react_frontend.yml | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/ci_react_frontend.yml diff --git a/.github/workflows/ci_react_frontend.yml b/.github/workflows/ci_react_frontend.yml new file mode 100644 index 0000000..3850067 --- /dev/null +++ b/.github/workflows/ci_react_frontend.yml @@ -0,0 +1,41 @@ +name: React CI + +on: + push: + branches: + - master + paths: + - 'react_frontend/**' + - '.github/workflows/ci_react_frontend.yml' + pull_request: + branches: + - master + paths: + - 'react_frontend/**' + - '.github/workflows/ci_react_frontend.yml' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Install dependencies + working-directory: ./react_frontend + run: npm install + + - name: Run build + working-directory: ./react_frontend + run: npm run build + + - name: Run tests + working-directory: ./react_frontend + run: npm test