Test openEO API #463
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test openEO API | |
on: | |
push: | |
paths: | |
- 'scripts/test_openEO.py' | |
schedule: | |
- cron: "*/10 * * * *" | |
jobs: | |
test-openeo-api: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11.0 | |
- name: Install openEO Client | |
run: pip install openeo | |
- name: Set Refresh Token as Environment Variable | |
run: echo "OPENEO_REFRESH_TOKEN=${{ secrets.OPENEO_REFRESH_TOKEN }}" >> $GITHUB_ENV | |
- name: Debug Refresh Token | |
run: | | |
if [ -n "$OPENEO_REFRESH_TOKEN" ]; then | |
echo "Refresh Token is set in environment." | |
echo "Token first 10 chars: $(echo $OPENEO_REFRESH_TOKEN | head -c 10)********" | |
else | |
echo "No Refresh Token found in GitHub Actions!" | |
exit 1 | |
fi | |
- name: Run openEO API Test | |
run: python scripts/test_openEO.py | |
- name: Commit Logs | |
if: always() | |
run: | | |
git config --global user.name "GitHub Action" | |
git config --global user.email "[email protected]" | |
git pull --rebase --autostash | |
git add results/logs/test_openEO.log | |
git commit -m "Updated openEO log" | |
git push |