134 lines
3.4 KiB
YAML
134 lines
3.4 KiB
YAML
name: git2go CI
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
- release-*
|
|
- v*
|
|
|
|
jobs:
|
|
|
|
build-static:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
go: [ '1.11', '1.12', '1.13', '1.14', '1.15', '1.16', '1.17' ]
|
|
name: Go ${{ matrix.go }}
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: ${{ matrix.go }}
|
|
id: go
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v1
|
|
- name: Build
|
|
run: |
|
|
git submodule update --init
|
|
sudo apt-get install -y --no-install-recommends libssh2-1-dev
|
|
make build-libgit2-static
|
|
- name: Test
|
|
run: make TEST_ARGS=-test.v test-static
|
|
|
|
build-dynamic:
|
|
strategy:
|
|
fail-fast: false
|
|
name: Go (dynamic)
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: '1.17'
|
|
id: go
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v1
|
|
- name: Build
|
|
run: |
|
|
git submodule update --init
|
|
sudo apt-get install -y --no-install-recommends libssh2-1-dev
|
|
make build-libgit2-dynamic
|
|
- name: Test
|
|
run: make TEST_ARGS=-test.v test-dynamic
|
|
|
|
build-system-dynamic:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
libgit2:
|
|
- 'v1.0.0'
|
|
- 'v1.1.0'
|
|
- 'v1.2.0'
|
|
- 'v1.3.0'
|
|
name: Go (system-wide, dynamic)
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: '1.17'
|
|
id: go
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v1
|
|
- name: Build libgit2 ${{ matrix.libgit2 }}
|
|
run: |
|
|
git submodule update --init
|
|
sudo apt-get install -y --no-install-recommends libssh2-1-dev
|
|
sudo env BUILD_LIBGIT_REF=${{ matrix.libgit2 }} ./script/build-libgit2.sh --dynamic --system
|
|
- name: Test
|
|
run: make TEST_ARGS=-test.v test
|
|
|
|
build-system-static:
|
|
strategy:
|
|
fail-fast: false
|
|
name: Go (system-wide, static)
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: '1.17'
|
|
id: go
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v1
|
|
- name: Build libgit2
|
|
run: |
|
|
git submodule update --init
|
|
sudo apt-get install -y --no-install-recommends libssh2-1-dev
|
|
sudo ./script/build-libgit2.sh --static --system
|
|
- name: Test
|
|
run: go test --count=1 --tags "static,system_libgit2" ./...
|
|
|
|
check-generate:
|
|
name: Check generated files were not modified
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: '1.17'
|
|
id: go
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2
|
|
- name: Install libgit2 build dependencies
|
|
run: |
|
|
git submodule update --init
|
|
sudo apt-get install -y --no-install-recommends libssh2-1-dev
|
|
go install golang.org/x/tools/cmd/stringer@latest
|
|
- name: Generate files
|
|
run: |
|
|
export PATH=$(go env GOPATH)/bin:$PATH
|
|
make generate
|
|
- name: Check nothing changed
|
|
run: git diff --quiet --exit-code || (echo "detected changes after generate" ; git status ; exit 1)
|