-
-
Notifications
You must be signed in to change notification settings - Fork 55
36 lines (33 loc) · 1.1 KB
/
pytest.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
name: Python package tests
on:
push:
pull_request:
types: [opened, synchronize, reopened]
schedule:
- cron: "0 12 * * 1"
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
setup-test-dir:
runs-on: ubuntu-latest
steps:
- name: Setup test dir
run: |
export TEST_DIR="tests/unit"
# if branch is 'main', or the repo is 'openclimatefix/quartz-solar-forecast'
# then run all tests, else run only unit tests
if [ ${{ github.event.repository.name }} == 'openclimatefix/quartz-solar-forecast' ] || [ ${{ github.ref }} == 'refs/heads/main' ]; then
export TEST_DIR=""
fi
echo $TEST_DIR"
call-run-python-tests:
needs: setup-test-dir
uses: openclimatefix/.github/.github/workflows/python-test.yml@issue/pip-all
with:
# pytest-cov looks at this folder
pytest_cov_dir: "quartz_solar_forecast"
os_list: '["ubuntu-latest"]'
python-version: "['3.11']"
extra_commands: echo "HF_TOKEN=${{ vars.HF_TOKEN }}" > .env
pytest_numcpus: '1'
test_dir: $TEST_DIR