Infra: Use Ruff and uv in dev environment #204
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@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Cache pip dependencies | |
uses: actions/cache@v4 | |
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@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Restore pip cache dependencies | |
uses: actions/cache@v4 | |
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: Test with pytest | |
run: | | |
sudo mkdir /config /icloud && | |
sudo chown -R $(id -u):$(id -g) /config /icloud && | |
ruff check && | |
ENV_CONFIG_FILE_PATH=./tests/data/test_config.yaml pytest | |
# - name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v3 | |
- 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@v4 | |
with: | |
name: tests-output | |
path: allure-history | |
retention-days: 1 | |
- name: Upload coverage artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ success() }} | |
with: | |
name: coverage-output | |
path: htmlcov | |
retention-days: 1 |