-
-
Notifications
You must be signed in to change notification settings - Fork 24
74 lines (62 loc) · 2.04 KB
/
pr-tests.yaml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Run tests on pull requests
on:
pull_request:
branches: [main]
push:
branches: [main]
env:
OPENAI_API_KEY: dummy_key
jobs:
run-tests:
runs-on: ubuntu-latest
name: Run test suite (Python ${{ matrix.python-version }}, ${{ matrix.environment-type }})
strategy:
matrix:
python-version: [3.11]
environment-type: ['miniconda', 'bare']
# https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Python environment
if: matrix.environment-type == 'bare'
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# See: https://github.com/marketplace/actions/setup-miniconda
- name: Setup miniconda
if: matrix.environment-type == 'miniconda'
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
miniforge-variant: Mambaforge
channels: conda-forge
activate-environment: llamabot
environment-file: environment.yml
use-mamba: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: matrix.environment-type == 'bare'
# 17 June 2023: Figure out a way to move testing deps to the `pip install -e .` step below.
run: |
python -m pip install -e ".[all]"
- name: Run tests
run: |
if [ "${{ matrix.environment-type }}" == "miniconda" ]; then
conda activate llamabot
fi
pip install -e ".[all]"
pytest
- name: Test CLI
run: |
pip install -e ".[all]"
llamabot --help
# https://github.com/codecov/codecov-action
- name: Upload code coverage
uses: codecov/codecov-action@v2
with:
# fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)