|
| 1 | +name: GeoNode Test Suites |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize, reopened, ready_for_review] |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + # ------------------------------------------------- |
| 10 | + # BUILD DOCKER IMAGES AND SHARE AS ARTIFACTS |
| 11 | + # ------------------------------------------------- |
| 12 | + build_images: |
| 13 | + name: Build and export Docker images |
| 14 | + runs-on: ubuntu-24.04 |
| 15 | + if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' && !github.event.pull_request.draft }} |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Checkout repository |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Build all services (Docker Compose v2) |
| 22 | + run: docker compose --env-file .env_test -f docker-compose-test.yml build --progress plain |
| 23 | + |
| 24 | + - name: Save built Docker images |
| 25 | + run: | |
| 26 | + mkdir -p docker_images |
| 27 | + docker save -o docker_images/django.tar geonode/geonode:latest-ubuntu-24.04 |
| 28 | +
|
| 29 | + - name: Upload Docker images as artifact |
| 30 | + uses: actions/upload-artifact@v4 |
| 31 | + with: |
| 32 | + name: docker-images |
| 33 | + path: docker_images |
| 34 | + retention-days: 1 |
| 35 | + |
| 36 | + # ------------------------------------------------- |
| 37 | + # REUSABLE WORKFLOW INVOCATIONS |
| 38 | + # ------------------------------------------------- |
| 39 | + smoke: |
| 40 | + uses: ./.github/workflows/run-test-suite.yml |
| 41 | + needs: build_images |
| 42 | + with: |
| 43 | + suite_name: "Smoke Tests" |
| 44 | + test_command: > |
| 45 | + ./tests/test.sh geonode.tests.smoke geonode.tests.test_rest_api geonode.tests.test_search |
| 46 | + geonode.tests.test_utils geonode.tests.test_headers --duration=30 --failfast |
| 47 | +
|
| 48 | + main: |
| 49 | + uses: ./.github/workflows/run-test-suite.yml |
| 50 | + needs: [build_images, smoke] |
| 51 | + with: |
| 52 | + suite_name: "Main Tests" |
| 53 | + test_command: > |
| 54 | + TESTS=$(python -c 'import sys; from geonode import settings; print(" ".join([a + ".tests" |
| 55 | + for a in settings.GEONODE_APPS if "security" not in a and "geoserver" not in a and "upload" not in a]))') && |
| 56 | + ./tests/test.sh $TESTS --duration=30 --failfast |
| 57 | +
|
| 58 | + security: |
| 59 | + uses: ./.github/workflows/run-test-suite.yml |
| 60 | + needs: [build_images, smoke] |
| 61 | + with: |
| 62 | + suite_name: "Security Tests" |
| 63 | + test_command: > |
| 64 | + TESTS=$(python -c 'import sys; from geonode import settings; print(" ".join([a + ".tests" |
| 65 | + for a in settings.GEONODE_APPS if "security" in a]))') && |
| 66 | + ./tests/test.sh $TESTS --duration=30 --failfast |
| 67 | +
|
| 68 | + gis_backend: |
| 69 | + uses: ./.github/workflows/run-test-suite.yml |
| 70 | + needs: [build_images, smoke] |
| 71 | + with: |
| 72 | + suite_name: "GIS Backend Tests" |
| 73 | + test_command: > |
| 74 | + TESTS=$(python -c 'import sys; from geonode import settings; print(" ".join([a + ".tests" |
| 75 | + for a in settings.GEONODE_APPS if "geoserver" in a]))') && |
| 76 | + ./tests/test.sh $TESTS --duration=30 --failfast |
| 77 | +
|
| 78 | + rest_apis: |
| 79 | + uses: ./.github/workflows/run-test-suite.yml |
| 80 | + needs: [build_images, smoke] |
| 81 | + with: |
| 82 | + suite_name: "REST API Tests" |
| 83 | + test_command: > |
| 84 | + ./tests/test.sh geonode.api.tests geonode.base.api.tests geonode.layers.api.tests |
| 85 | + geonode.maps.api.tests geonode.documents.api.tests geonode.geoapps.api.tests --duration=30 --failfast |
| 86 | +
|
| 87 | + csw: |
| 88 | + uses: ./.github/workflows/run-test-suite.yml |
| 89 | + needs: [build_images, smoke] |
| 90 | + with: |
| 91 | + suite_name: "CSW Tests" |
| 92 | + test_command: > |
| 93 | + ./tests/test.sh geonode.tests.csw geonode.catalogue.backends.tests --duration=30 --failfast |
| 94 | +
|
| 95 | + upload: |
| 96 | + uses: ./.github/workflows/run-test-suite.yml |
| 97 | + needs: [build_images, smoke] |
| 98 | + with: |
| 99 | + suite_name: "Upload Tests" |
| 100 | + test_command: > |
| 101 | + ./tests/test.sh geonode.upload --duration=30 --failfast |
| 102 | +
|
| 103 | + # ------------------------------------------------- |
| 104 | + # CLEANUP JOB: REMOVE ALL ARTIFACTS AT THE END |
| 105 | + # ------------------------------------------------- |
| 106 | + cleanup: |
| 107 | + name: Cleanup Artifacts |
| 108 | + needs: |
| 109 | + - smoke |
| 110 | + - main |
| 111 | + - security |
| 112 | + - gis_backend |
| 113 | + - rest_apis |
| 114 | + - csw |
| 115 | + - upload |
| 116 | + runs-on: ubuntu-24.04 |
| 117 | + if: always() |
| 118 | + steps: |
| 119 | + - name: Delete all uploaded artifacts |
| 120 | + uses: geekyeggo/delete-artifact@v5 |
| 121 | + with: |
| 122 | + failOnError: false |
0 commit comments