Skip to content

Implement comprehensive GitHub Actions integration tests using prod DEA ODC database #1111

Implement comprehensive GitHub Actions integration tests using prod DEA ODC database

Implement comprehensive GitHub Actions integration tests using prod DEA ODC database #1111

Workflow file for this run

name: Test DEA Notebooks with RDS Connection
on:
push:
branches: [ develop, stable, nbtests ]
paths-ignore:
- '**/*.md' # ignore markdown files
- '**/*.rst' # ignore restructured text files
- '.github/**' # ignore anything in .github folder
- '!.github/workflows/test_notebooks.yml' # except test_notebooks.yml
pull_request:
branches: [ develop, stable ]
paths-ignore:
- '**/*.md'
- '**/*.rst'
- '.github/**'
- '!.github/workflows/test_notebooks.yml'
schedule:
# Runs on the hour at UTC 6-9am every day
- cron: '0 6,7,8,9 * * *'
# Optional: Allow manual triggering through GitHub UI
workflow_dispatch:
permissions:
id-token: write # Required for OIDC authentication to AWS
contents: read
jobs:
test-notebooks:
runs-on: ubuntu-latest
strategy:
matrix:
tests: ["dea_tools", "beginners_guide", "dea_products", "how_to_guides", "real_world_examples", ""]
fail-fast: false
# Automatically activate our mamba environment when it's ready
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
with:
path: dea-notebooks
- name: Set up database access and tests
uses: ./dea-notebooks/.github/actions/test_setup
- name: Run DEA Notebooks tests
run: |
sudo chown -R 1000:100 ./dea-notebooks
cd ./dea-notebooks
docker run --rm \
--net=host \
--env DATACUBE_DB_URL \
--env AWS_SESSION_TOKEN \
--env AWS_REGION \
--env AWS_ACCESS_KEY_ID \
--env AWS_SECRET_ACCESS_KEY \
--env AWS_SESSION_TOKEN \
--volume ${GITHUB_WORKSPACE}/dea-notebooks:/home/jovyan/dea-notebooks \
--volume ${GITHUB_WORKSPACE}/tide_models:/var/share/tide_models \
--env GDAL_HTTP_MAX_RETRY=3 \
--entrypoint /bin/bash \
538673716275.dkr.ecr.ap-southeast-2.amazonaws.com/geoscienceaustralia/sandbox:stable \
/home/jovyan/dea-notebooks/Tests/test_notebooks.sh "${{ matrix.tests }}"