-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (41 loc) · 1.44 KB
/
CI.yml
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
buil_and_test:
runs-on: ubuntu-22.04
env:
ROOT_DIR: ${{ github.workspace }}
ROOT_TESTS_DATA: ${{ github.workspace }}/tests/data_for_tests
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install
run: |
python -m pip install --upgrade pip
pip install setuptools
pip install -e .[all]
- name: Create env file
# Création d'un fichier .env durant le process de CI
# Cf https://github.com/armgilles/vcub_keeper/issues/65
run: |
touch .env
echo KEY_API_BDX=${{ secrets.KEY_API_BDX }} >> .env
- name: Copy test data
run: |
cp -r ${{ env.ROOT_TESTS_DATA }}/* ${{ github.workspace }}/tests/
- name: Run tests
run: pytest --cov=api.calculator --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Run benchmarks
uses: CodSpeedHQ/action@v3
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: pytest tests/ --codspeed