Skip to content

Flexibilise Node definitions #154

Flexibilise Node definitions

Flexibilise Node definitions #154

Workflow file for this run

# some boiler plate generated by chat gpt
name: CI Workflow for Snakemake and pytest
on:
push:
branches:
- main # Trigger the workflow when pushing to the main branch
- py-tests # when pushing to py-tests branch for dev
pull_request:
branches:
- main # Trigger on pull requests to main branch
jobs:
run-tests:
runs-on: ubuntu-latest # Set the environment to Ubuntu
steps:
# Step 1: Checkout the repository code
- uses: actions/checkout@v4
# Step 2: Set up Conda
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: 'latest' # Use the latest version of Miniconda
environment-file: workflow/envs/environment.yaml # Point to your conda environment file (if exists)
auto-activate-base: false
activate-environment: pypsa-china
# /3 cache the Conda environment (for faster CI)
- name: Cache Conda environment
uses: actions/cache@v4
with:
path: ~/miniconda3
key: ${{ runner.os }}-conda-${{ hashFiles('workflow/envs/environment.yaml') }}
restore-keys: |
${{ runner.os }}-conda-
# 4/ Run tests using pytest
- name: Run pytest
shell: bash -el {0}
run: |
conda install pytest
pytest -v -s # Run pytest (make sure your tests are discovered and run)