-
Notifications
You must be signed in to change notification settings - Fork 21
54 lines (52 loc) · 1.45 KB
/
back-unit-test.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
name: Testing backend
on:
workflow_dispatch:
push:
branches:
- dev
paths:
- "back/**"
pull_request:
branches:
- dev
paths:
- "back/**"
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
back:
name: Test (red, py, moss)
runs-on: ubuntu-latest
strategy:
matrix:
redis-version: [6]
python-version: [3.12]
mosquitto-version: [2.0]
steps:
- uses: actions/checkout@v3
- name: Start Redis ${{ matrix.redis-version }}
uses: supercharge/[email protected]
with:
redis-version: ${{ matrix.redis-version }}
- name: Start MongoDB
uses: supercharge/[email protected]
- name: Start Mosquitto broker
uses: Namoshek/mosquitto-github-action@v1
with:
version: ${{ matrix.mosquitto-version }}
ports: '1883:1883'
password-file: ${{ github.workspace }}/configuration_templates/mosquitto_passwd
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -r requirements.txt
working-directory: ./back
- name: Install Pytest
run: pip install pytest
working-directory: ./back
- name: Test
run: pytest -v -s tests/unit_tests
working-directory: ./back