-
Notifications
You must be signed in to change notification settings - Fork 29
106 lines (104 loc) · 3.38 KB
/
ubuntu.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
95
96
97
98
99
100
101
102
103
104
105
106
name: build
on:
push:
branches:
- main
pull_request:
jobs:
ubuntu2004:
runs-on: ubuntu-20.04
env:
GODEBUG: cgocheck=2
strategy:
matrix:
go: [ '1.19', '1.20' ]
name: Go ${{ matrix.go }} + GDAL on ubuntu 20.04 test
steps:
- name: APT
run: sudo apt-get update && sudo apt-get install gcc g++ libgeos-c1v5 libproj15 libsqlite3-0 pkg-config libjpeg-turbo8 libgdal-dev
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Coverage Tests
run: go test . -race
install-gdal:
runs-on: ubuntu-20.04
strategy:
matrix:
gdal: [ 'release/3.4', 'release/3.5', 'release/3.6', 'master' ]
steps:
- name: optgdal
run: sudo mkdir /optgdal && sudo chown -R $USER /optgdal
- name: Checkout
uses: actions/checkout@v3
- name: cache gdal lib
id: cache-gdal
uses: actions/cache@v3
with:
path: /optgdal
key: ${{ runner.os }}-install-gdal-${{ matrix.gdal }}-${{ hashFiles('.github/workflows/build-gdal.sh') }}
- name: Build GDAL
if: steps.cache-gdal.outputs.cache-hit != 'true'
run: sudo .github/workflows/build-gdal.sh ${{ matrix.gdal }}
test:
needs: install-gdal
runs-on: ubuntu-20.04
env:
GODEBUG: cgocheck=2
strategy:
matrix:
go: [ '1.19', '1.20' ]
gdal: [ 'release/3.4', 'release/3.5', 'release/3.6', 'master' ]
name: Go ${{ matrix.go }} + GDAL ${{ matrix.gdal }} test
steps:
- name: APT
run: sudo apt-get update && sudo apt-get install gcc g++ libgeos-c1v5 libproj15 libsqlite3-0 pkg-config libjpeg-turbo8
- name: optgdal
run: sudo mkdir /optgdal && sudo chown -R $USER /optgdal
- name: Checkout
uses: actions/checkout@v3
- name: cache gdal lib
id: cache-gdal
uses: actions/cache@v3
with:
path: /optgdal
key: ${{ runner.os }}-install-gdal-${{ matrix.gdal }}-${{ hashFiles('.github/workflows/build-gdal.sh') }}
- name: Check GDAL
if: steps.cache-gdal.outputs.cache-hit != 'true'
uses: actions/github-script@v3
with:
script: |
core.setFailed('gdal installation not recovered from cache')
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: ldconfig
run: sudo ldconfig /optgdal/lib
- name: store gcp service-account to file
shell: bash
env:
GCP_SA: ${{ secrets.GCP_SA_KEY }}
run: |
echo "$GCP_SA" | base64 -d > gcp-keyfile.json
- name: Coverage Tests
run: go test . -cover -race -coverprofile=profile.cov
env:
PKG_CONFIG_PATH: /optgdal/lib/pkgconfig/
- name: Send coverage
if: ${{ matrix.go == '1.20' && matrix.gdal == 'master' }}
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
- name: golangci-lint
if: ${{ matrix.go == '1.20' && matrix.gdal == 'master' }}
uses: reviewdog/action-golangci-lint@v1
env:
PKG_CONFIG_PATH: /optgdal/lib/pkgconfig/
with:
golangci_lint_flags: "--timeout=5m --skip-files=doc_test.go"
level: error
fail_on_error: true