Skip to content

Commit

Permalink
Updated github CI/CD tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkc committed May 6, 2024
1 parent 62ec470 commit c17eac7
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,30 @@ on: ["push", "pull_request"]


jobs:
test-python:
test-api-python:
name: Coverage
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]
python-version: [3.10, 3.11, 3.12]
mongodb-version: ["3.6"]

steps:

# Check out Scout code
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# Set up python
- name: Set up Python ${{ matrix.python-version}}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version}}

- name: Production Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
pip install pytest-cov
pip install coveralls
- name: Test with pytest & Coveralls
pip install ./api[test]
- name: Test API with pytest & coveralls
run: |
pip install -r requirements-dev.txt
pytest --cov=./
pytest --cov ./api
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -49,11 +43,17 @@ jobs:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm run test
- name: Install node packages
working-directory: ./api
run: npm ci
- name: Build packages
working-directory: ./api
run: npm run build --if-present
- name: Run tests
working-directory: ./api
run: npm run test
11 changes: 10 additions & 1 deletion api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ description = "Gens API"
dependencies = [
"setuptools",
"wheel",
"click",
"requests",
"fastapi[all]",
"uvicorn[standard]",
Expand All @@ -19,6 +18,16 @@ authors = [
{name = "Markus Johansson", email = "[email protected]"},
]

[project.optional-dependencies]
test = [
"black",
"isort",
"mypy",
"pytest",
"pytest-cov",
"pytest-flask",
]

[project.urls]
Repository = "https://github.com/Clinical-Genomics-Lund/gens.git"
Issues = "https://github.com/Clinical-Genomics-Lund/gens/issues"
Expand Down
5 changes: 1 addition & 4 deletions frontend/tests/test_io.py → api/tests/test_io.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
"""Test IO related functions."""

import os
from unittest.mock import Mock

import pytest

from gens.io import _get_filepath
from app.io import _get_filepath


def test_get_filepath():
Expand Down
2 changes: 1 addition & 1 deletion frontend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies = [
]

[project.optional-dependencies]
dev = [
test = [
"black",
"isort",
"mypy",
Expand Down

0 comments on commit c17eac7

Please sign in to comment.