-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (47 loc) · 1.89 KB
/
Copy pathtests.yml
File metadata and controls
58 lines (47 loc) · 1.89 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
name: Run Tests
on:
pull_request:
push:
branches: [main, master]
jobs:
tests:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache Conda packages
uses: actions/cache@v4
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-pkgs-
restore-keys: |
${{ runner.os }}-conda-pkgs-
- name: Set up conda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.11
environment-file: environment.yml
activate-environment: hotel_management
use-mamba: true
auto-activate-base: false
- name: Install pip into conda env
run: conda run -n hotel_management conda install -y pip
- name: Install additional pip dependencies (CPU-safe version of torch)
run: |
conda run -n hotel_management python -m pip install torch==2.10.0
conda run -n hotel_management python -m pip install -r requirements.txt
conda run -n hotel_management python -m pip install pytest
conda run -n hotel_management python -m pip install coverage
conda run -n hotel_management python -m pip install httpx
- name: Show environment
run: conda run -n hotel_management conda list
- name: Debug environment
run: |
conda run -n hotel_management python -c "import sys; print(sys.executable)"
conda run -n hotel_management python -c "import coverage; print(coverage.__version__)"
- name: Run tests with coverage
run: |
conda run -n hotel_management python -m coverage run -m pytest -v --maxfail=1 --disable-warnings
- name: Show coverage summary and enforce minimum
run: |
conda run -n hotel_management python -m coverage report -m -i --fail-under=90