Skip to content

Commit

Permalink
Merge pull request #14 from deepskies/issue/test_and_lint
Browse files Browse the repository at this point in the history
Issue/test and lint
  • Loading branch information
beckynevin authored Jan 31, 2024
2 parents a3ddeeb + 7876802 commit af75a21
Show file tree
Hide file tree
Showing 12 changed files with 711 additions and 285 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint it

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Lint code
run: flake8 .

# Add other steps as needed, such as running additional linters or formatters
18 changes: 16 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Cache Poetry dependencies
uses: actions/cache@v2
with:
path: |
~/.cache
~/.local/share/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-poetry-
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
Expand All @@ -27,6 +36,11 @@ jobs:
shell: bash
run: python -m poetry install

- name: Create Environment File
run: echo "PYTHONPATH=$(pwd):$(pwd)/src" >> ${{ runner.workspace }}/.env

- name: Test with pytest
run: |
python3 -m poetry run pytest --cov
run: python -m poetry run pytest --cov
env:
PYTHONPATH: ${{ env.PYTHONPATH }}
ENV_FILE: ${{ runner.workspace }}/.env
Empty file added __init__.py
Empty file.
133 changes: 132 additions & 1 deletion poetry.lock

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

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ license = "MIT"
python = "^3.9"
jupyter = "^1.0.0"
sbi = "^0.22.0"
flake8 = "^7.0.0"
black = "^24.1.1"

[tool.poetry.dev-dependencies]
pytest = "^7.3.2"
Expand Down
Loading

0 comments on commit af75a21

Please sign in to comment.