Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial python linting #282

Closed
wants to merge 12 commits into from
70 changes: 0 additions & 70 deletions .github/workflows/ci.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/code-linting-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Code Linting

on:
workflow_dispatch:
push:
paths:
- '**/*.py'
branches:
- main
- dev
pull_request:
paths:
- '**/*.py'
branches:
- main
- dev

jobs:
unit-tests:
runs-on: ubuntu-latest
container:
image: hopkinsidd/flepimop:latest-dev
options: --user root
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Black Formatter Check
uses: psf/black@stable
with:
src: "."
options: "--check --quiet"
41 changes: 41 additions & 0 deletions .github/workflows/flepicommon-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: flepicommon-ci

on:
workflow_dispatch:
push:
paths:
- flepimop/R_packages/flepicommon/**/*
branches:
- main
- dev
pull_request:
paths:
- flepimop/R_packages/flepicommon/**/*
branches:
- main
- dev

jobs:
unit-tests:
runs-on: ubuntu-latest
container:
image: hopkinsidd/flepimop:latest-dev
options: --user root
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Set up Rprofile
run: |
cp build/docker/Docker.Rprofile $HOME/.Rprofile
cp /home/app/.bashrc $HOME/.bashrc
shell: bash
- name: Install local R packages
run: Rscript build/local_install.R
shell: bash
- name: Run flepicommon tests
run: |
setwd("flepimop/R_packages/flepicommon")
devtools::test(stop_on_failure=TRUE)
shell: Rscript {0}
48 changes: 48 additions & 0 deletions .github/workflows/gempyor-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: gempyor-ci

on:
workflow_dispatch:
push:
paths:
- examples/**/*
- flepimop/gempyor_pkg/**/*
branches:
- main
- dev
pull_request:
paths:
- examples/**/*
- flepimop/gempyor_pkg/**/*
branches:
- main
- dev

jobs:
unit-tests:
runs-on: ubuntu-latest
container:
image: hopkinsidd/flepimop:latest-dev
options: --user root
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Install the gempyor package
run: |
source /var/python/3.10/virtualenv/bin/activate
python -m pip install --upgrade pip
python -m pip install "flepimop/gempyor_pkg[test]"
shell: bash
- name: Run gempyor tests
run: |
source /var/python/3.10/virtualenv/bin/activate
cd flepimop/gempyor_pkg
pytest --exitfirst
shell: bash
- name: Run gempyor-cli integration tests from examples
run: |
source /var/python/3.10/virtualenv/bin/activate
cd examples
pytest --exitfirst
shell: bash
41 changes: 41 additions & 0 deletions .github/workflows/inference-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: inference-ci

on:
workflow_dispatch:
push:
paths:
- flepimop/R_packages/inference/**/*
branches:
- main
- dev
pull_request:
paths:
- flepimop/R_packages/inference/**/*
branches:
- main
- dev

jobs:
unit-tests:
runs-on: ubuntu-latest
container:
image: hopkinsidd/flepimop:latest-dev
options: --user root
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Set up Rprofile
run: |
cp build/docker/Docker.Rprofile $HOME/.Rprofile
cp /home/app/.bashrc $HOME/.bashrc
shell: bash
- name: Install local R packages
run: Rscript build/local_install.R
shell: bash
- name: Run inference tests
run: |
setwd("flepimop/R_packages/inference")
devtools::test(stop_on_failure=TRUE)
shell: Rscript {0}
Loading