Hide pull request template comments #44
Workflow file for this run
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 changed files on pull request | |
on: | |
pull_request: | |
branches: [ develop ] | |
permissions: | |
id-token: write # Required for OIDC authentication to AWS | |
contents: read | |
jobs: | |
test-notebooks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: dea-notebooks | |
- name: Get changed notebook files | |
id: changed-notebooks | |
uses: tj-actions/changed-files@v45 | |
with: | |
files: '**/*.ipynb' | |
separator: ' ' | |
- name: Print changed notebook files | |
if: steps.changed-notebooks.outputs.any_changed == 'true' | |
run: | | |
echo "Changed notebook files:" | |
echo "${{ steps.changed-notebooks.outputs.all_changed_files }}" | |
- name: Set up database access and tests | |
if: steps.changed-notebooks.outputs.any_changed == 'true' | |
uses: ./dea-notebooks/.github/actions/test_setup | |
with: | |
image: stable | |
- name: Test changed Jupyter notebooks only | |
if: steps.changed-notebooks.outputs.any_changed == 'true' | |
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=10 \ | |
--entrypoint /bin/bash \ | |
538673716275.dkr.ecr.ap-southeast-2.amazonaws.com/geoscienceaustralia/sandbox:stable \ | |
/home/jovyan/dea-notebooks/Tests/test_notebooks.sh "${{ steps.changed-notebooks.outputs.all_changed_files }}" | |
- name: Test DEA Tools | |
if: steps.changed-notebooks.outputs.any_changed == 'true' | |
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=10 \ | |
--entrypoint /bin/bash \ | |
538673716275.dkr.ecr.ap-southeast-2.amazonaws.com/geoscienceaustralia/sandbox:stable \ | |
/home/jovyan/dea-notebooks/Tests/test_notebooks.sh dea_tools |