Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
120 changes: 60 additions & 60 deletions .github/workflows/on_pr_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,80 +6,80 @@ jobs:
runs-on: ubuntu-22.04

steps:
- name: Check out code
uses: actions/checkout@v4
- name: Check out code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true

- name: Env Debug
run: |
go env
pwd
echo ${HOME}
echo ${GITHUB_WORKSPACE}
- name: Env Debug
run: |
go env
pwd
echo ${HOME}
echo ${GITHUB_WORKSPACE}

- name: Setup test environment
run: docker compose up -d
- name: Setup test environment
run: docker compose up -d

- name: Postgres Debug
env:
PGUSER: postgres
PGHOST: localhost
PGDATABASE: postgres
PGPASSWORD: postgres
run: |
psql -c "\l"
- name: Postgres Debug
env:
PGUSER: postgres
PGHOST: localhost
PGDATABASE: postgres
PGPASSWORD: postgres
run: |
psql -c "\l"

- name: Run tests
env:
# redis tests
RUN_REDIS_TESTS: yes
- name: Run tests
env:
# redis tests
RUN_REDIS_TESTS: yes

# AWS S3 tests
RUN_S3_TESTS: yes
AWS_TEST_BUCKET: tegola-ci
AWS_REGION: us-east-2
# AWS S3 tests
RUN_S3_TESTS: yes
AWS_TEST_BUCKET: tegola-ci
AWS_REGION: us-east-2

# PostGIS tests
RUN_POSTGIS_TESTS: yes
PGURI: postgres://postgres:postgres@localhost:5432/tegola
PGURI_NO_ACCESS: postgres://tegola_no_access:postgres@localhost:5432/tegola
PGSSLMODE: disable
PGSSLKEY: ""
PGSSLCERT: ""
PGSSLROOTCERT: ""
# PostGIS tests
RUN_POSTGIS_TESTS: yes
PGURI: postgres://postgres:postgres@localhost:5432/tegola
PGURI_NO_ACCESS: postgres://tegola_no_access:postgres@localhost:5432/tegola
PGSSLMODE: disable
PGSSLKEY: ""
PGSSLCERT: ""
PGSSLROOTCERT: ""

# HANA tests
RUN_HANA_TESTS: yes
# The credentials were exposed on purpose
# more information see: https://github.com/go-spatial/tegola/pull/893#discussion_r1136602372
HANA_CONNECTION_STRING: "hdb://TEGOLACI:iZgd6$nOdhf@917df316-4e01-4a10-be54-eac1b6ab15fb.hana.prod-us10.hanacloud.ondemand.com:443?TLSInsecureSkipVerify&TLSServerName=host&timeout=1000&max_connections=10"
run: |
go test -mod vendor -covermode atomic -coverprofile=profile.cov ./...
# HANA tests
RUN_HANA_TESTS: yes
# The credentials were exposed on purpose
# more information see: https://github.com/go-spatial/tegola/pull/893#discussion_r1136602372
HANA_CONNECTION_STRING: "hdb://TEGOLACI:iZgd6$nOdhf@917df316-4e01-4a10-be54-eac1b6ab15fb.hana.prod-us10.hanacloud.ondemand.com:443?TLSInsecureSkipVerify&TLSServerName=host&timeout=1000&max_connections=10"
run: |
go test -mod vendor -covermode atomic -coverprofile=profile.cov ./...

- name: Send coverage report to Coveralls
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go install -mod=vendor github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
- name: Send coverage report to Coveralls
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go install -mod=vendor github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github

- name: Build embedded UI
run: |
pushd ${GITHUB_WORKSPACE}/server
go generate ./...
popd
- name: Build embedded UI
run: |
pushd ${GITHUB_WORKSPACE}/server
go generate ./...
popd

- name: Tear down test environment
run: docker compose down
- name: Tear down test environment
run: docker compose down

govulncheck:
name: Run govulncheck
runs-on: ubuntu-22.04
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
Expand Down
33 changes: 19 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# this file is used to bootstrap services to run tegola tests against
version: "3"

services:
redis:
image: redis:6.2.6
container_name: redis
ports:
- 6379:6379
- 6379:6379

postgis:
image: postgis/postgis:12-3.0-alpine
Expand All @@ -21,7 +19,7 @@ services:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
- 5432:5432

migration:
image: postgis/postgis:12-3.0-alpine
Expand All @@ -32,14 +30,21 @@ services:
environment:
PGUSER: postgres
PGPASSWORD: postgres
command:
- /bin/bash
- -c
- |
wget "https://github.com/go-spatial/tegola-testdata/raw/master/tegola.dump"
psql -h postgis -p 5432 -U postgres -d postgres -c "DROP DATABASE IF EXISTS tegola;"
pg_restore -h postgis -p 5432 -U postgres -d postgres -C tegola.dump
psql -h postgis -U postgres -d postgres -c "DROP ROLE IF EXISTS tegola_no_access;CREATE ROLE tegola_no_access LOGIN PASSWORD 'postgres'"
rm tegola.dump

volumes:
- ./testdata:/testdata
command: ["/bin/bash", "-c", "testdata/postgis/migration.sh"]

# NOTE: useful for debugging
# does not run by default, only when you run with:
# docker-compose --profile pgadmin up (-d)
# afterwards navigate to localhost:5555 in the browser
pgadmin:
image: dpage/pgadmin4
container_name: pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: "[email protected]"
PGADMIN_DEFAULT_PASSWORD: "admin"
ports:
- "5555:80"
profiles:
- pgadmin
18 changes: 8 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ require (
github.com/go-spatial/proj v0.3.0
github.com/go-test/deep v1.1.1
github.com/golang/protobuf v1.5.3
github.com/jackc/pgproto3/v2 v2.3.3
github.com/jackc/pgtype v1.14.0
github.com/jackc/pgx/v4 v4.18.2
github.com/jackc/pgx-gofrs-uuid v0.0.0-20230224015001-1d428863c2e2
github.com/jackc/pgx/v5 v5.7.2
github.com/mattn/go-sqlite3 v1.14.22
github.com/mattn/goveralls v0.0.5
github.com/pborman/uuid v1.2.0
Expand All @@ -41,24 +40,22 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/gofrs/uuid v4.0.0+incompatible // indirect
github.com/gofrs/uuid/v5 v5.0.0 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.7.1 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.14.3 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/puddle v1.3.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/jmespath/go-jmespath v0.3.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.39.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rogpeppe/go-internal v1.14.0 // indirect
github.com/spf13/pflag v1.0.1 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
Expand All @@ -67,9 +64,10 @@ require (
golang.org/x/exp v0.0.0-20230116083435-1de6713980de // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
golang.org/x/tools v0.26.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.114.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
Loading