-
Notifications
You must be signed in to change notification settings - Fork 8
94 lines (94 loc) · 2.69 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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@3041bf56c941b39c61721a86cd11f3bb1338122a
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
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@3041bf56c941b39c61721a86cd11f3bb1338122a
with:
go-version: stable
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8
with:
version: v1.62.2
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@1bd1e32a3bdc45362d1e726936510720a7c30a57
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@3041bf56c941b39c61721a86cd11f3bb1338122a
with:
go-version: stable
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: test
run: |
sudo ldconfig
go test ./...