2022-07-29 14:05:15 +02:00
|
|
|
name: Tests
|
2022-07-29 13:18:07 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [ opened, reopened, edited ]
|
|
|
|
push:
|
|
|
|
|
|
|
|
env:
|
|
|
|
CC_TEST_REPORTER_ID: 40cb00907f7a10e04868e856570bb997ab9c42fd3b63d980f2b2269433195fdf
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-07-17 12:36:32 +02:00
|
|
|
python-version: ['3.8', '3.9', '3.10', '3.11']
|
2022-07-29 13:18:07 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
cache: 'pip'
|
|
|
|
- name: Install Ubuntu dependencies
|
2022-07-29 13:19:32 +02:00
|
|
|
run: sudo apt-get install -y libdbus-1-dev libgit2-dev libvirt-dev taskwarrior
|
2022-11-26 10:17:09 +01:00
|
|
|
- name: Install Python dependencies
|
2022-07-29 13:18:07 +02:00
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install -U coverage pytest pytest-mock freezegun
|
2023-10-26 09:19:46 +02:00
|
|
|
pip install 'pygit2<1' 'libvirt-python<6.3' 'feedparser<6' || true
|
|
|
|
pip install $(cat requirements/modules/*.txt | grep -v power | cut -d ' ' -f 1 | sort -u)
|
2022-07-29 14:02:54 +02:00
|
|
|
- name: Install Code Climate dependency
|
|
|
|
run: |
|
|
|
|
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
|
|
|
chmod +x ./cc-test-reporter
|
|
|
|
./cc-test-reporter before-build
|
2022-07-29 13:18:07 +02:00
|
|
|
- name: Run tests
|
|
|
|
run: |
|
2022-07-29 13:39:06 +02:00
|
|
|
coverage run --source=. -m pytest tests -v
|
2022-11-26 10:17:09 +01:00
|
|
|
- name: Report coverage
|
2022-11-26 12:09:04 +01:00
|
|
|
uses: paambaati/codeclimate-action@v3.2.0
|
2022-07-29 13:29:50 +02:00
|
|
|
with:
|
2022-07-29 13:35:58 +02:00
|
|
|
coverageCommand: coverage3 xml
|
2022-07-29 13:29:50 +02:00
|
|
|
debug: true
|