prepare for interface changes with gdal 3.10 #388
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |