-
Notifications
You must be signed in to change notification settings - Fork 28
105 lines (103 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
name: build
on:
push:
branches:
- main
pull_request:
jobs:
ubuntu:
runs-on: ${{ matrix.os }}
env:
GOEXPERIMENT: cgocheck2
strategy:
matrix:
os: [ 'ubuntu-20.04', 'ubuntu-22.04' ]
go: [ '1.22' ]
name: Go ${{ matrix.go }} + GDAL on ${{ matrix.os }} test
steps:
- name: APT
run: sudo apt-get update && sudo apt-get install gcc g++ pkg-config 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-22.04
strategy:
matrix:
gdal: [ 'release/3.6', 'release/3.7', 'release/3.8', 'release/3.9', '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: ubuntu-22.04-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-22.04
strategy:
matrix:
go: [ '1.21', '1.22' ]
gdal: [ 'release/3.6', 'release/3.7', 'release/3.8', 'release/3.9', 'master' ]
name: Go ${{ matrix.go }} + GDAL ${{ matrix.gdal }} test
steps:
- name: APT
run: sudo apt-get update && sudo apt-get install gcc g++ '^libgeos-c1v[0-9]$' '^libproj[0-9]{2}$' '^libsqlite3-[0-9]$' 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: ubuntu-22.04-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.22' && matrix.gdal == 'master' }}
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
- name: golangci-lint
if: ${{ matrix.go == '1.22' && 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