2022-02-25 19:30:15 +01:00
|
|
|
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
|
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
|
|
|
2022-02-26 01:10:35 +01:00
|
|
|
name: PyTest
|
2022-02-25 19:30:15 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
2023-04-08 21:10:23 +02:00
|
|
|
test:
|
2022-02-25 19:30:15 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-10-17 17:15:57 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-02-25 19:30:15 +01:00
|
|
|
- name: Set up Python 3.10
|
2024-03-08 10:41:46 +01:00
|
|
|
uses: actions/setup-python@v5
|
2022-02-25 19:30:15 +01:00
|
|
|
with:
|
|
|
|
python-version: "3.10"
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2024-02-24 11:40:24 +01:00
|
|
|
sudo apt update && sudo apt install -y podman
|
2022-02-25 19:30:15 +01:00
|
|
|
python -m pip install --upgrade pip
|
|
|
|
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
2023-12-11 00:26:58 +01:00
|
|
|
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
|
2024-03-08 10:00:34 +01:00
|
|
|
- name: Test with unittest
|
2022-02-25 19:30:15 +01:00
|
|
|
run: |
|
2024-03-08 10:00:34 +01:00
|
|
|
coverage run --source podman_compose -m unittest pytests/*.py
|
|
|
|
python -m unittest tests/*.py
|
2023-12-11 00:26:58 +01:00
|
|
|
coverage combine
|
|
|
|
coverage report
|
2024-03-08 14:33:55 +01:00
|
|
|
env:
|
|
|
|
TESTS_DEBUG: 1
|