forked from NCSU-SE-2024/PackReview_v3
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.4 KB
/
test-app.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:latest
ports:
- 27017:27017
options: >-
--health-cmd "mongosh --eval 'db.runCommand({ ping: 1 })'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest # Include flake8 for linting and pytest if needed
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Create config.ini from secret
env:
CONFIG_INI: ${{ secrets.CONFIG_INI }}
run: |
echo "$CONFIG_INI" > tests/config.ini
- name: Run Unit Tests with unittest
run: |
python -m unittest discover tests -p "test_*.py" # Change 'tests' to your test directory if different