Merge pull request #10 from Coda-Research-Group/training-tests #35
Workflow file for this run
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: | |
- '**' | |
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 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r training/requirements.txt | |
pip install pytest pytest-cov | |
cd training && pip install -e . | |
- name: Run tests with pytest and generate coverage | |
run: | | |
cd /home/runner/work/AlphaFind/AlphaFind/training | |
export PYTHONPATH=$PYTHONPATH:$(pwd) | |
pytest -v --cov=. --cov-report=xml --cov-report=term-missing | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: training/coverage.xml |