-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.18 KB
/
test.yml
File metadata and controls
47 lines (40 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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