generated from microsoft/python-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbb7093
commit ecc35c0
Showing
3 changed files
with
33 additions
and
105 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: myenv | ||
name: sr2silo | ||
channels: | ||
- defaults | ||
- conda-forge | ||
|