marintosti12 commited on
Commit
603201a
·
1 Parent(s): 9d9324f

`feat(ci/cd): Créatoion fichier ci avec github actions

Browse files
Files changed (1) hide show
  1. .github/ci.yaml +40 -13
.github/ci.yaml CHANGED
@@ -1,26 +1,53 @@
1
  name: CI
 
2
  on:
 
 
3
  pull_request:
4
- branches: [main]
5
 
6
  jobs:
7
- test-build:
8
  runs-on: ubuntu-latest
 
 
 
 
 
 
9
  steps:
10
- - uses: actions/checkout@v4
 
 
 
 
 
 
 
 
 
 
 
11
 
12
- - uses: actions/setup-node@v4
 
13
  with:
14
- node-version: 20
 
 
 
 
 
 
 
 
15
 
16
- - name: API — install & test
17
- working-directory: api
18
  run: |
19
- npm ci
20
- npm test --if-present
21
 
22
- - name: Frontend install & build
23
- working-directory: frontend
24
  run: |
25
- npm ci
26
- npm run build
 
1
  name: CI
2
+
3
  on:
4
+ push:
5
+ branches: [ main, dev, test, "feature/*", "fix/*" ]
6
  pull_request:
7
+ branches: [ main, dev, test ]
8
 
9
  jobs:
10
+ test:
11
  runs-on: ubuntu-latest
12
+ timeout-minutes: 10
13
+
14
+ strategy:
15
+ matrix:
16
+ python-version: [ "3.10", "3.11", "3.12" ]
17
+
18
  steps:
19
+ - name: Checkout
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+
27
+ - name: Install Poetry
28
+ uses: abatilo/actions-poetry@v3
29
+ with:
30
+ poetry-version: "1.8.3"
31
 
32
+ - name: Cache Poetry virtualenv
33
+ uses: actions/cache@v4
34
  with:
35
+ path: |
36
+ ~/.cache/pypoetry
37
+ .venv
38
+ key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
39
+ restore-keys: |
40
+ ${{ runner.os }}-poetry-${{ matrix.python-version }}-
41
+
42
+ - name: Install deps (no dev)
43
+ run: poetry install --no-interaction --no-ansi
44
 
45
+ - name: Lint (ruff)
 
46
  run: |
47
+ poetry run python -m pip install ruff
48
+ poetry run ruff check .
49
 
50
+ - name: Tests (pytest + coverage)
 
51
  run: |
52
+ poetry run python -m pip install pytest pytest-cov
53
+ poetry run pytest -q --maxfail=1 --disable-warnings --cov=src --cov-report=term-missing