Skip to content

Add spatial index on codepoints #11

Add spatial index on codepoints

Add spatial index on codepoints #11

Workflow file for this run

name: Build and publish Docker image
on:
push:
branches: ["main"]
tags: ["v*.*.*"]
pull_request:
branches: ["main"]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
checks: write
services:
docker:
image: docker:dind
options: --privileged
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Install testcontainers dependencies
run: docker --version
- name: Cache Docker images
uses: actions/cache@v4
with:
path: /var/lib/docker
key: ${{ runner.os }}-docker-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-docker-
- name: Test
run: |
go install gotest.tools/gotestsum@latest
mkdir -p ./test-reports/
gotestsum --junitfile=./test-reports/junit.xml --format github-actions -- -v -coverprofile=profile.cov -coverpkg=./... ./...
- name: Collect test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports
path: ./test-reports/
- name: Publish test results
uses: mikepenz/action-junit-report@v5
if: always()
with:
report_paths: "./test-reports/junit.xml"
comment: true
include_passed: true
detailed_summary: true
- name: Upload coverage to Coveralls
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
- name: Lint
uses: golangci/golangci-lint-action@v8
docker-publish:
concurrency:
group: "publishing"
needs:
- build-and-test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository with full history
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: "Log into registry: ${{ env.REGISTRY }}"
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
type=sha
labels: |
maintainer=rm-hull
org.opencontainers.image.description=REST API for GPS routes
org.opencontainers.image.licenses=MIT
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64 #,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max