Skip to content

Commit 8df9cfb

Browse files
authored
ci: aggiungi job test con pytest e codecov (#27)
* ci: aggiungi job test con pytest e codecov, build dipende da test - job test: pytest --cov su ubuntu-latest python 3.12, upload coverage codecov - job build: needs test, gira solo dopo test passati - trigger: push+PR su src/** tests/** pyproject.toml * fix(ci): build non gira su PR, branches filter su pull_request - build: if: github.event_name != 'pull_request' — evita publish da PR (tokn read-only su fork, semantica sbagliata su PR interne) - pull_request trigger: branches: [main] per coerenza con push trigger
1 parent 6864f6f commit 8df9cfb

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/build-context.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,40 @@ on:
1010
paths:
1111
- 'dataciviclab.config.yml'
1212
- 'src/**'
13+
- 'tests/**'
14+
- 'pyproject.toml'
15+
pull_request:
16+
branches: [main]
17+
paths:
18+
- 'src/**'
19+
- 'tests/**'
20+
- 'pyproject.toml'
1321

1422
jobs:
23+
test:
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- uses: actions/checkout@v6
28+
29+
- uses: actions/setup-python@v6
30+
with:
31+
python-version: '3.12'
32+
33+
- name: Install
34+
run: pip install -e ".[dev]"
35+
36+
- name: Test
37+
run: pytest --cov=src/agent_context_builder --cov-report=xml
38+
39+
- name: Upload coverage
40+
uses: codecov/codecov-action@v4
41+
with:
42+
fail_ci_if_error: false
43+
1544
build:
45+
needs: test
46+
if: github.event_name != 'pull_request'
1647
runs-on: ubuntu-latest
1748
permissions:
1849
contents: write

0 commit comments

Comments
 (0)