2019-08-15 02:38:02 -05:00
|
|
|
name: git2go CI
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-09-04 15:33:34 -05:00
|
|
|
- main
|
2020-02-22 17:07:08 -06:00
|
|
|
- release-*
|
2019-08-15 02:38:02 -05:00
|
|
|
- v*
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2020-02-22 17:07:08 -06:00
|
|
|
build-static:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-09-03 08:28:00 -05:00
|
|
|
go: [ '1.11', '1.12', '1.13', '1.14', '1.15', '1.16', '1.17' ]
|
2020-02-22 17:07:08 -06:00
|
|
|
name: Go ${{ matrix.go }}
|
|
|
|
|
2020-08-15 19:19:53 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2020-02-22 17:07:08 -06:00
|
|
|
|
|
|
|
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
|
2020-12-06 13:55:04 -06:00
|
|
|
sudo apt-get install -y --no-install-recommends libssh2-1-dev
|
2020-02-22 17:07:08 -06:00
|
|
|
make build-libgit2-static
|
|
|
|
- name: Test
|
2020-12-06 08:13:38 -06:00
|
|
|
run: make TEST_ARGS=-test.v test-static
|
2020-02-22 17:07:08 -06:00
|
|
|
|
|
|
|
build-dynamic:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
name: Go (dynamic)
|
|
|
|
|
2020-08-15 19:19:53 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2020-02-22 17:07:08 -06:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v1
|
|
|
|
with:
|
2021-09-04 15:33:34 -05:00
|
|
|
go-version: '1.17'
|
2020-02-22 17:07:08 -06:00
|
|
|
id: go
|
2019-08-15 02:38:02 -05:00
|
|
|
- name: Check out code into the Go module directory
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Build
|
2019-08-15 02:42:58 -05:00
|
|
|
run: |
|
|
|
|
git submodule update --init
|
2020-12-06 13:55:04 -06:00
|
|
|
sudo apt-get install -y --no-install-recommends libssh2-1-dev
|
2020-02-22 17:07:08 -06:00
|
|
|
make build-libgit2-dynamic
|
|
|
|
- name: Test
|
2020-12-06 08:13:38 -06:00
|
|
|
run: make TEST_ARGS=-test.v test-dynamic
|
2020-08-15 19:19:53 -05:00
|
|
|
|
|
|
|
build-system-dynamic:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
2020-11-28 13:10:34 -06:00
|
|
|
matrix:
|
2021-09-04 22:07:24 -05:00
|
|
|
libgit2:
|
2022-10-04 09:50:57 -05:00
|
|
|
- 'v1.5.0'
|
2020-08-15 19:19:53 -05:00
|
|
|
name: Go (system-wide, dynamic)
|
|
|
|
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v1
|
|
|
|
with:
|
2021-09-04 15:33:34 -05:00
|
|
|
go-version: '1.17'
|
2020-08-15 19:19:53 -05:00
|
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
|
|
|
uses: actions/checkout@v1
|
2020-11-28 13:10:34 -06:00
|
|
|
- name: Build libgit2 ${{ matrix.libgit2 }}
|
2020-08-15 19:19:53 -05:00
|
|
|
run: |
|
|
|
|
git submodule update --init
|
2020-12-06 13:55:04 -06:00
|
|
|
sudo apt-get install -y --no-install-recommends libssh2-1-dev
|
2021-09-04 22:07:24 -05:00
|
|
|
sudo env BUILD_LIBGIT_REF=${{ matrix.libgit2 }} ./script/build-libgit2.sh --dynamic --system
|
2020-08-15 19:19:53 -05:00
|
|
|
- name: Test
|
2020-12-06 08:13:38 -06:00
|
|
|
run: make TEST_ARGS=-test.v test
|
2020-08-15 19:19:53 -05:00
|
|
|
|
|
|
|
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:
|
2021-09-04 15:33:34 -05:00
|
|
|
go-version: '1.17'
|
2020-08-15 19:19:53 -05:00
|
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Build libgit2
|
|
|
|
run: |
|
|
|
|
git submodule update --init
|
2020-12-06 13:55:04 -06:00
|
|
|
sudo apt-get install -y --no-install-recommends libssh2-1-dev
|
2020-08-15 19:19:53 -05:00
|
|
|
sudo ./script/build-libgit2.sh --static --system
|
|
|
|
- name: Test
|
|
|
|
run: go test --count=1 --tags "static,system_libgit2" ./...
|
2021-11-08 08:38:55 -06:00
|
|
|
|
|
|
|
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)
|