Skip to content

Commit

Permalink
Add CPU tests market and GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle1668 committed Feb 10, 2023
1 parent 7a9b638 commit 0a29ce5
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/cpu_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Run CPU Tests"

on: "push"

jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Upgrade Pip
run: python -m pip install --upgrade pip

- name: Install Dependencies
run: |
pip install -e .[dev]
# - name: Install Dependencies
# run: |
# sudo apt-get install libopenmpi-dev -y
# pip install torch==1.8.2 torchvision==0.9.2 torchaudio==0.8.2 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cpu
# pip install -r requirements/requirements.txt
# pip install -r requirements/requirements-dev.txt

# - name: Prepare Data
# run: python prepare_data.py

- name: Run CPU Tests
run: pytest tests -m cpu
2 changes: 2 additions & 0 deletions elk/tests/extraction/test_gen_parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import pytest
from elk.extraction.parser import get_extraction_parser


@pytest.mark.cpu
def test_args_no_underscores():
"""
Assert that there are no underscores in the CLI parameter names. We wish
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ elk = "elk.__main__:run"

[tool.setuptools]
packages = ["elk"]

[tool.pytest.ini_options]
markers = ["cpu: Marker for tests that do not depend on GPUs"]

0 comments on commit 0a29ce5

Please sign in to comment.