|
| 1 | +name: GeoNode Test Suites |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +jobs: |
| 7 | + build_images: |
| 8 | + name: Build and cache Docker images |
| 9 | + runs-on: ubuntu-24.04 |
| 10 | + |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v4 |
| 13 | + |
| 14 | + - name: Set up Docker Buildx |
| 15 | + uses: docker/setup-buildx-action@v3 |
| 16 | + |
| 17 | + # Crea una chiave cache univoca per ogni run manuale |
| 18 | + - name: Define cache key |
| 19 | + id: cache-key |
| 20 | + run: echo "key=geonode-cache-${{ github.run_id }}" >> $GITHUB_OUTPUT |
| 21 | + |
| 22 | + - name: Restore Docker layer cache |
| 23 | + uses: actions/cache@v4 |
| 24 | + with: |
| 25 | + path: /tmp/.buildx-cache |
| 26 | + key: ${{ steps.cache-key.outputs.key }} |
| 27 | + |
| 28 | + - name: Build stack (using cache) |
| 29 | + run: | |
| 30 | + docker-compose --env-file .env_test -f docker-compose-test.yml build \ |
| 31 | + --build-arg BUILDKIT_INLINE_CACHE=1 \ |
| 32 | + --progress plain |
| 33 | + env: |
| 34 | + DOCKER_BUILDKIT: 1 |
| 35 | + BUILDKIT_CACHE: /tmp/.buildx-cache |
| 36 | + |
| 37 | + - name: Export cache for next jobs |
| 38 | + if: always() |
| 39 | + run: | |
| 40 | + echo "Cache directory after build:" |
| 41 | + du -sh /tmp/.buildx-cache || true |
| 42 | +
|
| 43 | + - name: Upload build cache |
| 44 | + uses: actions/upload-artifact@v4 |
| 45 | + with: |
| 46 | + name: buildx-cache |
| 47 | + path: /tmp/.buildx-cache |
| 48 | + |
| 49 | + # Ogni job usa la cache e non rebuilda |
| 50 | + geonode_test_suite_smoke: |
| 51 | + name: Smoke Tests |
| 52 | + needs: build_images |
| 53 | + uses: ./.github/workflows/_geonode-build.yml |
| 54 | + with: |
| 55 | + codecov_name: smoke_tests |
| 56 | + test_suite: ./tests/test.sh geonode.tests.smoke geonode.tests.test_rest_api geonode.tests.test_search geonode.tests.test_utils geonode.tests.test_headers |
| 57 | + |
| 58 | + geonode_test_suite: |
| 59 | + name: Main Tests |
| 60 | + needs: build_images |
| 61 | + uses: ./.github/workflows/_geonode-build.yml |
| 62 | + with: |
| 63 | + codecov_name: main_tests |
| 64 | + test_suite: ./tests/test.sh $(python -c "import sys;from geonode import settings;sys.stdout.write(' '.join([a+'.tests' for a in settings.GEONODE_APPS if 'security' not in a and 'geoserver' not in a and 'upload' not in a]))") geonode.thumbs.tests geonode.people.tests geonode.people.socialaccount.providers.geonode_openid_connect.tests |
| 65 | + |
| 66 | + geonode_test_security: |
| 67 | + name: Security Tests |
| 68 | + needs: build_images |
| 69 | + uses: ./.github/workflows/_geonode-build.yml |
| 70 | + with: |
| 71 | + codecov_name: security_tests |
| 72 | + test_suite: ./tests/test.sh $(python -c "import sys;from geonode import settings;sys.stdout.write(' '.join([a+'.tests' for a in settings.GEONODE_APPS if 'security' in a]))") |
| 73 | + |
| 74 | + geonode_test_gis_backend: |
| 75 | + name: GIS Backend Tests |
| 76 | + needs: build_images |
| 77 | + uses: ./.github/workflows/_geonode-build.yml |
| 78 | + with: |
| 79 | + codecov_name: gis |
| 80 | + test_suite: ./tests/test.sh $(python -c "import sys;from geonode import settings;sys.stdout.write(' '.join([a+'.tests' for a in settings.GEONODE_APPS if 'geoserver' in a]))") |
| 81 | + |
| 82 | + geonode_test_rest_apis: |
| 83 | + name: REST API Tests |
| 84 | + needs: build_images |
| 85 | + uses: ./.github/workflows/_geonode-build.yml |
| 86 | + with: |
| 87 | + codecov_name: api |
| 88 | + test_suite: ./tests/test.sh geonode.api.tests geonode.base.api.tests geonode.layers.api.tests geonode.maps.api.tests geonode.documents.api.tests geonode.geoapps.api.tests |
| 89 | + |
| 90 | + geonode_test_csw: |
| 91 | + name: CSW Tests |
| 92 | + needs: build_images |
| 93 | + uses: ./.github/workflows/_geonode-build.yml |
| 94 | + with: |
| 95 | + codecov_name: csw |
| 96 | + test_suite: ./tests/test.sh geonode.tests.csw geonode.catalogue.backends.tests |
| 97 | + |
| 98 | + geonode_upload: |
| 99 | + name: Upload Tests |
| 100 | + needs: build_images |
| 101 | + uses: ./.github/workflows/_geonode-build.yml |
| 102 | + with: |
| 103 | + codecov_name: importer |
| 104 | + test_suite: ./tests/test.sh geonode.upload |
0 commit comments