forked from TrueCloudLab/distribution
6e8dd268a8
Go 1.16 reached end of life, so update to the current version of Go, but also run CI on the previous version (which is still supported). We should probably also decide wether or not we want the Dockerfiles to pin to a specific minor version; this makes the releases more deterministic. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
56 lines
1.5 KiB
YAML
56 lines
1.5 KiB
YAML
name: CI
|
|
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
go-version: ["1.17.x", "1.18.x"]
|
|
platform: ["ubuntu-latest"]
|
|
runs-on: ${{ matrix.platform }}
|
|
env:
|
|
DOCKER_BUILDTAGS: "include_oss include_gcs"
|
|
CGO_ENABLED: 1
|
|
GO111MODULE: "auto"
|
|
GOPATH: ${{ github.workspace }}
|
|
GOOS: linux
|
|
COMMIT_RANGE: ${{ github.event_name == 'pull_request' && format('{0}..{1}',github.event.pull_request.base.sha, github.event.pull_request.head.sha) || format('{0}..{1}', github.event.before, github.event.after) }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
path: src/github.com/distribution/distribution
|
|
fetch-depth: 50
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: Dependencies
|
|
run: |
|
|
sudo apt-get -q update
|
|
sudo -E apt-get -yq --no-install-suggests --no-install-recommends install python2-minimal
|
|
cd /tmp && go install github.com/vbatts/git-validation@latest
|
|
|
|
- name: Build
|
|
working-directory: ./src/github.com/distribution/distribution
|
|
run: |
|
|
DCO_VERBOSITY=-q script/validate/dco
|
|
go build -i .
|
|
make build
|
|
make binaries
|
|
if [ "$GOOS" = "linux" ]; then make coverage ; fi
|
|
|
|
- uses: codecov/codecov-action@v1
|
|
with:
|
|
directory: ./src/github.com/distribution/distribution
|