OpenHands/.github/workflows/fe-unit-tests.yml
mamoodi 340fe0de18
Split Frontend and Python Unit tests (#3399)
* Split Frontend and Python Unit tests

* Extra comment for deploy docs workflow

* Simpler comment

* Add paths and paths-ignore to unit tests

* More specific comment for py unit tests

* Remove paths-ignore because jobs are required

---------

Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2024-08-16 11:39:14 -04:00

40 lines
1016 B
YAML

# Workflow that runs frontend unit tests
name: Run Frontend Unit Tests
# * Always run on "main"
# * Run on PRs that have changes in the "frontend" folder or this workflow
on:
push:
branches:
- main
pull_request:
paths:
- 'frontend/**'
- '.github/workflows/fe-unit-tests.yml'
jobs:
# Run frontend unit tests
fe-test:
name: FE Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
working-directory: ./frontend
run: npm ci
- name: Run tests and collect coverage
working-directory: ./frontend
run: npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}