Skip to content

Commit

Permalink
Decoupled linting and testing, and updated badges in README.
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericpoitevin committed Jan 24, 2022
1 parent dfa5157 commit 1b7fedc
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 47 deletions.
14 changes: 0 additions & 14 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@ coverage:
round: up
precision: 2
status:
project:
default:
target: 90%
threshold: 2%
base: auto
flags:
- unit
# advanced
branches:
- master
if_not_found: error
if_ci_failed: error
informational: False
only_pulls: false
patch:
default:
# basic
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "Lint"

on:
push:
branches: [master,github-actions-test]
paths-ignore:
- 'README.md'
- '.deepsource.toml'
- '.gitignore'
- 'setup.py'

pull_request:
branches: [master]
paths-ignore:
- 'README.md'
- '.deepsource.toml'
- '.gitignore'
- 'setup.py'


jobs:
build:

runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-18.04]
python-version: [3.9]
test-folder : ['tests']
fail-fast: false

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build using Python ${{matrix.python-version}}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python-version}}
- name: install dependencies [pip]
run: |
pip install --upgrade pip setuptools wheel
for req in dev-requirements.txt; do
pip install -q -r $req
done
pip install -e .
- name: linting [black and isort]
run: |
black . --check
isort --profile black --check .
- name: linting [flake8]
run: |
flake8 simSPI tests
17 changes: 3 additions & 14 deletions .github/workflows/test_docker.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "Linting and Testing (Docker)"
# https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action
name: "Test"

on:
push:
branches: [master,temsim-test-in-container]
branches: [master,github-actions-test]
paths-ignore:
- 'README.md'
- '.deepsource.toml'
Expand All @@ -26,17 +26,6 @@ jobs:
- name: Check Out Repo
uses: actions/checkout@v2

- name: dryrun
uses: ./docker/
id: dryrun

- name: linting [flake8]
uses: ./docker/
id: linting
with:
command: |
flake8 --config=/work/.flake8 /work/simSPI /work/tests
- name: unit testing [pytest]
uses: ./docker/
id: testing
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/test_singularity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ name: "Linting and Testing (Singularity)"

on:
push:
branches: [simspi-test-singularity]
branches: [test-singularity]
paths-ignore:
- 'README.md'
- '.deepsource.toml'
- '.gitignore'
- 'setup.py'


pull_request:
branches: [simspi-test-singularity]
branches: [test-singularity]
paths-ignore:
- 'README.md'
- '.deepsource.toml'
Expand All @@ -33,12 +32,6 @@ jobs:
with:
singularity-version: 3.8.3

- name: linting [flake8]
run: >
singularity exec docker://${{ secrets.DOCKER_HUB_USERNAME }}/simspi:latest
/bin/bash /opt/entrypoint.sh
flake8 --config=/work/.flake8 /work/simSPI /work/tests
- name: unit testing [pytest]
run: >
singularity exec docker://${{ secrets.DOCKER_HUB_USERNAME }}/simspi:latest
Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Build](https://github.com/compSPI/simSPI/actions/workflows/build.yml/badge.svg)](https://github.com/compSPI/simSPI/actions/workflows/build.yml)
[![Codecov](https://codecov.io/gh/compSPI/ioSPI/branch/master/graph/badge.svg?token=OBVOV3ZM1O)](https://codecov.io/gh/compSPI/simSPI)
[![Test](https://github.com/compSPI/simSPI/actions/workflows/test.yml/badge.svg)](https://github.com/compSPI/simSPI/actions/workflows/test.yml)
[![Lint](https://github.com/compSPI/simSPI/actions/workflows/lint.yml/badge.svg)](https://github.com/compSPI/simSPI/actions/workflows/lint.yml)
[![Codecov](https://codecov.io/gh/compSPI/simSPI/branch/master/graph/badge.svg?token=OBVOV3ZM1O)](https://codecov.io/gh/compSPI/simSPI)
[![DeepSource](https://deepsource.io/gh/compSPI/simSPI.svg/?label=active+issues&show_trend=true&token=9eFu6aig3-oXQIuhdDoYTEq-)](https://deepsource.io/gh/compSPI/simSPI/?ref=repository-badge)

# simSPI
Expand All @@ -8,13 +9,20 @@ Methods and tools for simulating SPI data.

# Download

First create a conda environment with the required dependencies using the `enviroment.yml` file as follows:
First download:

git clone https://github.com/compSPI/simSPI.git

Then, create a conda environment with the required dependencies using the `environment.yml` file as follows:

conda env create --file environment.yml

Then download:
Finally, install simSPI in this environment:

conda activate simSPI
pip install -e .

git clone https://github.com/compSPI/ioSPI.git
Alternatively, pull the simSPI container from [DockerHub](https://hub.docker.com/repository/docker/fpoitevi/simspi)

# Contribute

Expand Down
5 changes: 5 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
black
flake8
flake8-docstrings
isort
pre-commit
5 changes: 0 additions & 5 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ dependencies:
- codecov
- configparser
- coverage
- flake8-black
- flake8-docstrings
- flake8-import-order
- h5py
- mdtraj
- mrcfile
Expand All @@ -22,9 +19,7 @@ dependencies:
- pytorch=1.9.0
- pytorch3d
- pip:
- black==20.8b0
- geomstats
- git+https://github.com/compSPI/ioSPI.git
- pre-commit
- raster_geometry
- starfile

0 comments on commit 1b7fedc

Please sign in to comment.