-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (49 loc) · 1.66 KB
/
run-unit-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
---
name: Run Unit Tests
on:
# run at 8am every Monday morning
schedule:
- cron: '0 8 * * 1'
# run with each new Pull Request opened to the main branch
pull_request:
branches:
- main
jobs:
runscript:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# update list with desired Python versions to test
python-version: ["3.12"]
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
- name: Register hydrodata credentials as a public user
env:
TEST_EMAIL_PUBLIC: ${{ secrets.TEST_EMAIL_PUBLIC }}
TEST_PIN_PUBLIC: ${{ secrets.TEST_PIN_PUBLIC }}
run: |
python utils/set_credentials.py --public
- name: Run public-access unit tests with pytest
run: |
pytest tests/hf_hydrodata -m "not private_dataset"
- name: Register hydrodata credentials as a user with private dataset access
env:
TEST_EMAIL_PRIVATE: ${{ secrets.TEST_EMAIL_PRIVATE }}
TEST_PIN_PRIVATE: ${{ secrets.TEST_PIN_PRIVATE }}
run: |
python utils/set_credentials.py --private
# Run only the tests that require private dataset access level
- name: Run private-access unit tests with pytest
run: |
pytest tests/hf_hydrodata/test_gridded.py -m private_dataset