Skip to content

Commit

Permalink
pretty
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonkoehn committed Nov 12, 2024
1 parent cbb7093 commit ecc35c0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 105 deletions.
62 changes: 0 additions & 62 deletions .github/workflows/poetry-conda.yml

This file was deleted.

74 changes: 32 additions & 42 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,65 @@
# This pipeline checks whether the package
# installs properly, passes unit tests and whether
# the code formatting is right.
name: CI/CD
name: CI/CD (Poetry + Conda)

on:
push:
branches: [ main ]
branches: [ main ] # Or your main branch name
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.10"]
poetry-version: ["1.8.3"]

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout code
uses: actions/checkout@v3

- name: Run black formatting check
uses: psf/black@stable

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge, bioconda
environment-file: environment.yml
activate-environment: myenv
activate-environment: sr2silo

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
version: ${{ matrix.poetry-version }}

- name: Cache dependencies
id: cache-deps
uses: actions/cache@v2
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}

- name: Activate Conda environment
shell: bash -l {0}
run: |
source $(conda info --base)/etc/profile.d/conda.sh
conda activate myenv
- name: Set Python version for Poetry
run: poetry env use $(which python)

- name: Install the dependencies
run: poetry install --no-interaction --no-root --with dev
if: steps.cache-deps.outputs.cache-hit != 'true'
conda activate sr2silo
conda install -c conda-forge poetry
- name: Install the module
run: poetry install --with dev --no-interaction
run: |
source $(conda info --base)/etc/profile.d/conda.sh
conda activate sr2silo
poetry install --with dev --no-interaction
- name: Run unit tests
run: poetry run pytest
run: |
source $(conda info --base)/etc/profile.d/conda.sh
conda activate sr2silo
poetry run pytest
- name: Run Ruff
run: poetry run ruff check .
run: |
source $(conda info --base)/etc/profile.d/conda.sh
conda activate sr2silo
poetry run ruff check .
- name: Run interrogate
run: poetry run interrogate src
run: |
source $(conda info --base)/etc/profile.d/conda.sh
conda activate sr2silo
poetry run interrogate src
- name: Run Pyright (type checking)
run: poetry run pyright
- name: Run Pyright
run: |
source $(conda info --base)/etc/profile.d/conda.sh
conda activate sr2silo
poetry run pyright
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: myenv
name: sr2silo
channels:
- defaults
- conda-forge
Expand Down

0 comments on commit ecc35c0

Please sign in to comment.