Repository navigation
70 lines (56 loc) · 1.96 KB
/
Copy pathci.yml
File metadata and controls
70 lines (56 loc) · 1.96 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: CI
on:
push:
branches:
- master # Ejecuta pruebas al hacer push en la rama 'master'
env:
env_var: ${{ vars.ENV_CONTEXT_VAR }}
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.13', '3.14']
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }} # Configura la versión de Python desde la matriz
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.[dev]'
- name: Run Ruff (lint)
run: ruff check .
- name: Run Ruff (format)
run: ruff format --check .
- name: Run mypy
run: mypy
# Solo los tests `dummy` (deterministas, seguros contra la API real
# — no necesitan datos de una cuenta específica). `readonly`/`risky`
# quedan fuera de CI a propósito, ver README/Makefile.
- name: Run Python tests
env:
APIGATEWAY_API_TOKEN: ${{ secrets.APIGATEWAY_API_TOKEN }}
TEST_CONTRIBUYENTE_RUT: ${{ vars.TEST_CONTRIBUYENTE_IDENTIFICADOR }} # Variable necesaria para test_contribuyentes.
run: |
mkdir -p var
pytest -v \
--junitxml=var/tests-results.xml \
--cov=apigatewaycl \
--cov-report=xml:var/tests-coverage.xml
- name: Upload pytest result report
if: failure()
uses: actions/upload-artifact@v4
with:
name: tests-results-python_${{ matrix.python-version }}.xml
path: var/tests-results.xml
- name: Upload Coverage Report
uses: actions/upload-artifact@v4
with:
name: tests-coverage-python_${{ matrix.python-version }}.xml
path: var/tests-coverage.xml
- name: Display Python version
run: python --version