Skip to content

Update GitHub Actions #475

Update GitHub Actions

Update GitHub Actions #475

Workflow file for this run

name: main
on:
pull_request:
push:
branches:
- master
tags:
- v*
env:
GOTOOLCHAIN: local
jobs:
main:
strategy:
fail-fast: false
matrix:
go-version:
- stable
- oldstable
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo apt-get install -y libgeos-dev
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
- uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Generate
run: |
go generate ./...
git diff --exit-code
- name: Build
run: go build ./...
- name: Test
run: go test ./... # FIXME enable race detector
lint:
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo apt-get install -y libgeos-dev
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: stable
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
- uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8
with:
version: v1.60.3
geos-versions:
strategy:
fail-fast: false
matrix:
geos-version:
- 3.10.2 # Used in Ubuntu 22.04 LTS
- 3.10.6 # Latest 3.10.x
- 3.11.4 # Latest 3.11.x
- 3.12.1 # Used in Ubuntu 24.04 LTS
- 3.12.2 # Latest 3.12.x
runs-on: ubuntu-22.04
steps:
- uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8
id: cache-geos
with:
path: ~/work/geos-${{ matrix.geos-version }}
key: ${{ runner.os }}-geos-${{ matrix.geos-version }}
- name: build-geos
if: ${{ steps.cache-geos.outputs.cache-hit != 'true' }}
run: |
cd ~/work
curl https://download.osgeo.org/geos/geos-${{ matrix.geos-version }}.tar.bz2 | tar xjf -
cd geos-${{ matrix.geos-version }}
mkdir _build
cd _build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
make -j4
ctest
- name: install-geos
run: |
cd ~/work/geos-${{ matrix.geos-version }}/_build
sudo make install
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: stable
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
- name: test
run: |
sudo ldconfig
go test ./...