Skip to content

Commit

Permalink
Enable normal build workflows again
Browse files Browse the repository at this point in the history
  • Loading branch information
danduk82 committed Oct 1, 2024
1 parent 617b59f commit 7b83563
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 39 deletions.
46 changes: 16 additions & 30 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,25 @@ jobs:
uses: actions/checkout@v2
with:
submodules: recursive
# - name: Setup Java
# uses: actions/setup-java@v2
# with:
# distribution: 'temurin'
# java-version: '21'
# cache: 'maven'
- name: Install CI dependencies
run: python3 -m pip install --user --requirement=ci/requirements.txt

# - name: Validate source code formatting
# run: make lint

# - name: Build and test
# run: |
# make install test
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'

# - name: Build docker images
# run: |
# make build-image
- name: Validate source code formatting
run: make lint

- name: Run acceptance tests
- name: Build and test
run: |
make acceptance-tests
make install test
- name: Print docker compose logs
run: (cd compose && c2cciutils-docker-logs)
if: always()

- name: Cleanup acceptance tests
- name: Build docker images
run: |
make stop-acceptance-tests
make build-image
# - name: Remove project jars from cached repository
# run: |
# rm -rf ~/.m2/repository/org/geoserver
# find ~/.m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
- name: Remove project jars from cached repository
run: |
rm -rf ~/.m2/repository/org/geoserver
find ~/.m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
28 changes: 26 additions & 2 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,33 @@ jobs:
run: |
make build-image
- name: Run acceptance tests
- name: Install CI dependencies
run: python3 -m pip install --user --requirement=ci/requirements.txt

- name: Run acceptance tests datadir
run: |
make acceptance-tests-datadir
- name: Print docker compose logs datadir
run: (cd compose && c2cciutils-docker-logs)
if: always()

- name: Cleanup acceptance tests datadir
run: |
make acceptance-tests
make clean-acceptance-tests-datadir
# FIXME: fix pgconfig discrepancies before reactivating
# - name: Run acceptance tests pgconfig
# run: |
# make acceptance-tests-pgconfig

# - name: Print docker compose logs pgconfig
# run: (cd compose && c2cciutils-docker-logs)
# if: always()

# - name: Cleanup acceptance tests pgconfig
# run: |
# make clean-acceptance-tests-pgconfig

- name: Remove project jars from cached repository
run: |
Expand Down
22 changes: 17 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,24 @@ verify-image:
build-acceptance:
docker build --tag=acceptance:$(TAG) acceptance_tests

.PHONY: acceptance-tests
acceptance-tests:
acceptance-tests: build-acceptance
.PHONY: acceptance-tests-pgconfig
acceptance-tests-pgconfig:
acceptance-tests-pgconfig: build-acceptance
(cd compose/ && TAG=$(TAG) GS_USER=$(UID):$(GID) docker compose $(COMPOSE_ACCEPTANCE_PGCONFIG_OPTIONS) up -d)
(cd compose/ && TAG=$(TAG) GS_USER=$(UID):$(GID) docker compose $(COMPOSE_ACCEPTANCE_PGCONFIG_OPTIONS) exec -T acceptance bash -c 'until [ -f /tmp/healthcheck ]; do echo "Waiting for /tmp/healthcheck to be available..."; sleep 5; done && pytest . -vvv --color=yes')

.PHONY: clean-acceptance-tests-pgconfig
clean-acceptance-tests-pgconfig:
(cd compose/ && TAG=$(TAG) GS_USER=$(UID):$(GID) docker compose $(COMPOSE_ACCEPTANCE_PGCONFIG_OPTIONS) down -v)

.PHONY: acceptance-tests-datadir
acceptance-tests-datadir:
acceptance-tests-datadir: build-acceptance
(cd compose/ && TAG=$(TAG) GS_USER=$(UID):$(GID) docker compose $(COMPOSE_ACCEPTANCE_DATADIR_OPTIONS) up -d)
(cd compose/ && TAG=$(TAG) GS_USER=$(UID):$(GID) docker compose $(COMPOSE_ACCEPTANCE_DATADIR_OPTIONS) exec -T acceptance bash -c 'until [ -f /tmp/healthcheck ]; do echo "Waiting for /tmp/healthcheck to be available..."; sleep 5; done && pytest . -vvv --color=yes')

.PHONY: stop-acceptance-tests
stop-acceptance-tests: build-acceptance
.PHONY: clean-acceptance-tests-datadir
clean-acceptance-tests-datadir:
(cd compose/ && TAG=$(TAG) GS_USER=$(UID):$(GID) docker compose $(COMPOSE_ACCEPTANCE_DATADIR_OPTIONS) down -v)
rm -rf compose/catalog-datadir/*
touch compose/catalog-datadir/.keep
2 changes: 0 additions & 2 deletions compose/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ services:
depends_on:
geodatabase:
condition: service_healthy
init-datadir:
condition: service_completed_successfully
gateway:
condition: service_healthy
discovery:
Expand Down

0 comments on commit 7b83563

Please sign in to comment.