Skip to content

update test ubuntu and go versions #420

update test ubuntu and go versions

update test ubuntu and go versions #420

Workflow file for this run

name: build
on:
push:
branches:
- main
pull_request:
jobs:
ubuntu:
runs-on: ${{ matrix.os }}
env:
GOEXPERIMENT: cgocheck2
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-18.04', 'ubuntu-20.04', 'ubuntu-22.04', 'ubuntu-24.04' ]
go: [ '1.23' ]
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@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Coverage Tests
run: go test . -race
install-gdal:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
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@v4
- name: cache gdal lib
id: cache-gdal
uses: actions/cache@v4
with:
path: /optgdal
key: ubuntu-24.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-24.04
strategy:
fail-fast: false
matrix:
go: [ '1.22', '1.23' ]
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@v4
- name: cache gdal lib
id: cache-gdal
uses: actions/cache@v4
with:
path: /optgdal
key: ubuntu-24.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@v7
with:
script: |
core.setFailed('gdal installation not recovered from cache')
- name: Setup Go
uses: actions/setup-go@v5
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.23' && matrix.gdal == 'release/3.9' }}
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
- name: golangci-lint
if: ${{ matrix.go == '1.23' && matrix.gdal == 'release/3.9' }}
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