Skip to content

Commit

Permalink
fix: add unit tests for frontend in the pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekzyla committed Jul 28, 2023
1 parent d042f5f commit 62aad6e
Showing 1 changed file with 34 additions and 8 deletions.
42 changes: 34 additions & 8 deletions .github/workflows/ci-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:
- "next"
jobs:
test-unit-backend:
name: Test Unit Python ${{ matrix.python-version }}
name: Test Backend Unit Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
env:
VALUES_DIRECTORY: /tmp
Expand All @@ -45,15 +45,41 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install packages
run: |
cd backend
pip install -r ./requirements.txt
working-directory: ./backend
run: pytest
- name: Run Pytest
run: |
cd backend
pytest
working-directory: ./backend
run: pytest
- uses: actions/upload-artifact@v3 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results-unit-python_${{ matrix.python-version }}
path: test-results/*
path: test-results/*
test-unit-frontned:
name: Test Frontend Unit Node ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- 16
steps:
- uses: actions/checkout@v2
- name: Set Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install
dir: 'frontend'
- name: Build production bundle
uses: borales/actions-yarn@v4
with:
cmd: build
dir: 'frontend'
- name: Run test in sub-folder
uses: borales/actions-yarn@v4
with:
cmd: test
dir: 'frontend'

0 comments on commit 62aad6e

Please sign in to comment.