-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (57 loc) · 1.76 KB
/
unit-tests.yml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Unit Tests ⚙️
on: [push, pull_request]
permissions:
contents: read
packages: write
issues: write
pull-requests: write
jobs:
main:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Setup Python ${{ matrix.python-version }}
with:
python-version: ${{ matrix.python-version }}
- name: Create config file
run: |
echo '{
"base_url": "http://localhost:5050",
"broker_hostname": "globalbroker.meteo.fr",
"broker_password": "everyone",
"broker_port": 443,
"broker_protocol": "websockets",
"broker_username": "everyone",
"download_workers": 1,
"download_dir": "downloads",
"flask_host": "0.0.0.0",
"flask_port": 5050,
"log_level": "DEBUG",
"log_path": "logs",
"min_free_space": 10,
"mqtt_session_info" : "mqtt_session.json",
"save_logs": false,
"validate_topics": true
}' > config.json
shell: bash
- name: Set config environment variable
run: |
CONFIG_PATH="$PWD/config.json"
echo "WIS2DOWNLOADER_CONFIG=$CONFIG_PATH" >> "$GITHUB_ENV"
- name: Install requirements 📦
run: |
python3 -m pip install --upgrade pip
pip3 install --no-cache .
pip3 install -r requirements-dev.txt
- name: run tests ⚙️
run: |
python <<!
from wis2downloader.app import app
from wis2downloader.downloader import DownloadWorker
quit()
!
pytest