Skip to content

Commit

Permalink
Use service account for CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aazuspan committed Jan 29, 2025
1 parent 3215f13 commit 4df17ff
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import os
import warnings
from collections import UserDict
from pathlib import Path
Expand Down Expand Up @@ -65,7 +66,13 @@ def object_cache():


def pytest_sessionstart(session):
ee.Initialize()
if os.environ.get("GITHUB_ACTIONS"):
service_account = os.environ.get("EE_SERVICE_ACCOUNT")
credentials = ee.ServiceAccountCredentials(None, key_data=service_account)
else:
credentials = "persistent"

ee.Initialize(credentials=credentials)


@pytest.fixture(autouse=True)
Expand Down

0 comments on commit 4df17ff

Please sign in to comment.