Merge pull request #9 from Coda-Research-Group/ui-tests #31
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: CI | |
on: | |
push: | |
# Sequence of patterns matched against refs/heads | |
branches: | |
# Push events on main and dev branch | |
- main | |
- ui-tests | |
# Sequence of patterns matched against refs/tags | |
tags: '*' | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '21.6.0' # Match the version in your Dockerfile | |
- name: Install UI dependencies | |
working-directory: ./ui | |
run: | | |
npm ci | |
npm install --save-dev @vitest/coverage-v8 | |
- name: Run tests with coverage | |
working-directory: ./ui | |
run: npm run test:coverage | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: code-coverage-report | |
path: ui/coverage/ | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Make run.sh executable | |
run: chmod +x ./run.sh | |
- name: Docker build training, backend, and frontend | |
run: ./run.sh |