-
Notifications
You must be signed in to change notification settings - Fork 16
45 lines (37 loc) · 1.21 KB
/
run-tests-on-push-or-merge-pr-master.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
45
name: on_push_or_merge_pr_master
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Miniconda
uses: goanpeca/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.12
- name: Create or update Conda environment
shell: bash -l {0}
run: |
conda env create --file environment.yml --name GridTradingBot || conda env update --file environment.yml --name GridTradingBot
- name: Set PYTHONPATH
run: echo "PYTHONPATH=$(pwd)" >> $GITHUB_ENV
- name: Run tests and upload coverage
run: |
conda run -n GridTradingBot python -m pip install --upgrade pip
conda run -n GridTradingBot pytest --cov=core --cov=config --cov=strategies --cov=utils --cov-report=xml:coverage.xml --cov-report=term --cov-config=pytest.ini
continue-on-error: true
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true