Skip to content

test fixed

test fixed #41

Workflow file for this run

name: Run Tests on main
# Trigger this workflow when pushing to the main branch
on:
push:
branches:
- main
pull_request:
branches:
- main
# Define the job to run the tests
jobs:
test:
runs-on: ubuntu-latest
steps:
# Checkout the code from the repository
- name: Checkout repository
uses: actions/checkout@v3
# Set up Python environment
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11.9' # Specify Python version (e.g., '3.9')
# Install Poetry
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"
# Install dependencies using Poetry
- name: Install dependencies
run: |
poetry install
# Run pytest to execute tests
- name: Generate .config file inside the test folder
run: |
echo "[codegreen]" > .codegreencore.config
echo "ENTSOE_token=${{ secrets.ENTSOE_TOKEN }}" >> .codegreencore.config
echo "enable_energy_caching=false" >> .codegreencore.config
- name: Run tests
run: |
poetry run pytest