From b89df2642b03d1a30efbf57129a036ee6c7c744d Mon Sep 17 00:00:00 2001 From: Zac Deziel Date: Wed, 8 Jan 2025 12:10:56 -0800 Subject: [PATCH] Update CI to authenticate to earthengine --- .github/workflows/ci.yml | 14 ++++++++++++++ test/test_map.py | 1 + 2 files changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6afd704..a6279f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,20 @@ jobs: run: | sudo apt update sudo apt install -y qgis python3-qgis python3-pyqt5 python3-pytest + + - name: Set Environment Variables + run: | + echo "QGIS_HOME=/usr" >> $GITHUB_ENV + echo "QT_QPA_PLATFORM=offscreen" >> $GITHUB_ENV + echo "DISPLAY=:99" >> $GITHUB_ENV + + - name: Start Virtual Display + run: Xvfb :99 -screen 0 1024x768x24 & + + - name: Configure Earth Engine Credentials + run: | + mkdir -p ~/.config/earthengine # Create the directory if it doesn't exist + echo '${{ secrets.EE_CREDENTIALS_JSON }}' > ~/.config/earthengine/credentials - name: Install dependencies run: | diff --git a/test/test_map.py b/test/test_map.py index 2e0bf99..8a270be 100644 --- a/test/test_map.py +++ b/test/test_map.py @@ -12,6 +12,7 @@ def setup_ee(): import ee ee.Initialize() + ee.Authenticate(auth_mode="localhost", quiet=True) @pytest.fixture(scope="module", autouse=True)