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 7, 2024
1 parent 7d6cf24 commit 03a99a3
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 29 deletions.
38 changes: 19 additions & 19 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/tests
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -45,15 +39,21 @@ jobs:

strategy:
matrix:
node-version: [17.x]
node-version: [20.8.x]
# 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: ./frontend
run: npm ci
- name: Build packages
working-directory: ./frontend
run: npm run build --if-present
- name: Run tests
working-directory: ./frontend
run: npm run test
12 changes: 11 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,17 @@ authors = [
{name = "Markus Johansson", email = "[email protected]"},
]

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

[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.coverage import _get_filepath


def test_get_filepath():
Expand Down
8 changes: 4 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 03a99a3

Please sign in to comment.