Skip to content

Add GitHub Actions workflow for unit tests #4

Add GitHub Actions workflow for unit tests

Add GitHub Actions workflow for unit tests #4

Workflow file for this run

name: Run Unit Tests
on:
push:
branches:
- 315-Unittest-via-Github-actions # Trigger only on this specific branch
pull_request:
branches:
- 315-Unittest-via-Github-actions # Trigger only on pull requests to this branch
jobs:
test:
name: Run Unit Tests Across Python Versions
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v3
# Step 2: Set up Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Step 3: Install Filip Library
- name: Clone Filip with Submodules
run: |
git clone --recurse-submodules https://github.com/RWTH-EBC/filip.git
cd filip
pip install -e .
# Step 4: Set up Environment Variables
- name: Set up Test Environment
run: |
echo "LOG_LEVEL=INFO" >> tests/.env
echo "CB_URL=http://localhost:1026" >> tests/.env
echo "IOTA_JSON_URL=http://localhost:4041" >> tests/.env
echo "IOTA_UL_URL=http://localhost:4061" >> tests/.env
echo "QL_URL=http://localhost:8668" >> tests/.env
echo "MQTT_BROKER_URL=mqtt://localhost:1883" >> tests/.env
echo "FIWARE_SERVICE=filip" >> tests/.env
echo "FIWARE_SERVICEPATH=/testing" >> tests/.env
# Step 5: Run Unit Tests
- name: Run Unit Tests
run: |
python -m unittest discover tests --verbose