-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (80 loc) · 3.1 KB
/
Copy pathci.yaml
File metadata and controls
95 lines (80 loc) · 3.1 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# CI workflow for Entity Resolution Engine (ERE)
# ===============================================
# Runs on push to develop and on PRs targeting develop.
#
# Jobs:
# 1. quality — Install, lint, test & verify (tox)
name: CI
on:
push:
branches: [develop]
pull_request:
branches: [develop]
permissions:
contents: read
jobs:
quality:
name: Lint, Test & Verify
runs-on: ubuntu-latest
services:
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
# ------------------------------------------------------------------
# Checkout
# ------------------------------------------------------------------
- uses: actions/checkout@v6
with:
fetch-depth: 0
# ------------------------------------------------------------------
# Python & Poetry
# ------------------------------------------------------------------
- name: Read Python version from pyproject.toml
id: python-version
run: echo "version=$(grep -m1 'python = ' src/pyproject.toml | grep -oP '\d+\.\d+' | head -1)" >> $GITHUB_OUTPUT
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ steps.python-version.outputs.version }}
- name: Install Poetry
run: pipx install poetry
- name: Configure git credentials for private dependencies
run: |
git config --global url."https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
# NOTE: If GITHUB_TOKEN lacks cross-repo access, replace with:
# git config --global url."https://x-access-token:${{ secrets.GH_TOKEN_PRIVATE_REPOS }}@github.com/".insteadOf "https://github.com/"
# ------------------------------------------------------------------
# Dependency caching
# ------------------------------------------------------------------
- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
.tox
key: poetry-${{ runner.os }}-${{ hashFiles('src/poetry.lock', 'tox.ini') }}
restore-keys: |
poetry-${{ runner.os }}-
# ------------------------------------------------------------------
# Install
# ------------------------------------------------------------------
- name: Install dependencies
run: cd src && poetry install --with dev
# ------------------------------------------------------------------
# Lint, Test & Verify (tox)
# ------------------------------------------------------------------
- name: Prepare environment file
run: cp src/infra/.env.example src/infra/.env
- name: Run quality checks (unit tests + architecture + clean-code)
run: cd src && poetry run tox -e py312,architecture,clean-code
env:
REDIS_HOST: localhost
REDIS_PORT: 6379
REDIS_PASSWORD: ""