CI - Pull Request #195
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI - Pull Request | |
on: | |
pull_request: | |
branches: [main] | |
paths: | |
- src/** | |
- tests/** | |
- Dockerfile | |
- pylintrc | |
- pytest.ini | |
- requirements-test.txt | |
- requirements.txt | |
- run-ci.sh | |
workflow_dispatch: | |
jobs: | |
cache-requirements-install: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Cache pip dependencies | |
uses: actions/cache@v3 | |
id: cache-dependencies | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
run: | | |
pip install -r requirements-test.txt | |
test: | |
needs: cache-requirements-install | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Restore pip cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
pip install -r requirements-test.txt | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
- name: Test with pytest | |
run: | | |
sudo mkdir /config /icloud && sudo chown -R $(id -u) /config /icloud && pylint src/ tests/ && pytest | |
- name: Generate Allure Report | |
uses: simple-elf/allure-report-action@master | |
if: always() | |
with: | |
allure_results: allure-results | |
allure_history: allure-history | |
keep_reports: 100 | |
- name: Upload tests artifacts | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: tests-output | |
path: allure-history | |
retention-days: 1 | |
- name: Upload coverage artifacts | |
uses: actions/upload-artifact@v3 | |
if: ${{ success() }} | |
with: | |
name: coverage-output | |
path: htmlcov | |
retention-days: 1 |