Skip to content

Commit e94b98a

Browse files
committed
add hf-hydrodata public credentials
1 parent 81c9a84 commit e94b98a

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

.github/workflows/run-unit-tests.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
python-version: ['3.10', '3.12']
30+
python-version: ['3.12']
3131

3232
steps:
3333
- name: Check out code
@@ -44,6 +44,13 @@ jobs:
4444
python -m pip install --upgrade pip
4545
pip install . --group test
4646
47+
- name: Register hf-hydrodata credentials as a public user
48+
env:
49+
TEST_EMAIL_PUBLIC: ${{ secrets.TEST_EMAIL_PUBLIC }}
50+
TEST_PIN_PUBLIC: ${{ secrets.TEST_PIN_PUBLIC }}
51+
run: |
52+
python utils/set_test_credentials.py
53+
4754
- name: Run unit tests
4855
run: |
4956
pytest --verbose

utils/set_test_credentials.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""Set user credentials for hf_hydrodata package."""
2+
3+
# pylint: disable=C0413
4+
5+
import sys
6+
import os
7+
8+
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../src")))
9+
import hf_hydrodata as hf
10+
11+
12+
def main():
13+
"""Use environment variable secrets to set hf_hydrodata credentials
14+
for GitHub Actions testing."""
15+
test_email = str(os.environ["TEST_EMAIL_PUBLIC"])
16+
test_pin = str(os.environ["TEST_PIN_PUBLIC"])
17+
18+
hf.register_api_pin(test_email, test_pin)
19+
20+
21+
if __name__ == "__main__":
22+
main()

0 commit comments

Comments
 (0)