2021-01-29 20:40:09 +01:00
|
|
|
name: CI
|
|
|
|
|
2021-01-29 21:42:19 +01:00
|
|
|
|
2021-01-29 20:40:09 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
build:
|
2021-08-10 11:45:30 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-07-06 05:43:13 +02:00
|
|
|
go-version: ["1.16.x", "1.17.x"]
|
2021-08-10 11:45:30 +02:00
|
|
|
platform: ["ubuntu-latest"]
|
|
|
|
runs-on: ${{ matrix.platform }}
|
2021-01-29 20:40:09 +01:00
|
|
|
env:
|
|
|
|
DOCKER_BUILDTAGS: "include_oss include_gcs"
|
|
|
|
CGO_ENABLED: 1
|
|
|
|
GO111MODULE: "auto"
|
|
|
|
GOPATH: ${{ github.workspace }}
|
|
|
|
GOOS: linux
|
2021-01-29 21:38:04 +01:00
|
|
|
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) }}
|
2021-01-29 20:40:09 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
2020-08-24 13:18:39 +02:00
|
|
|
path: src/github.com/distribution/distribution
|
2021-01-29 20:40:09 +01:00
|
|
|
fetch-depth: 50
|
|
|
|
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2021-08-10 11:45:30 +02:00
|
|
|
go-version: ${{ matrix.go-version }}
|
2021-01-29 20:40:09 +01:00
|
|
|
|
|
|
|
- name: Dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get -q update
|
2021-03-23 11:04:14 +01:00
|
|
|
sudo -E apt-get -yq --no-install-suggests --no-install-recommends install python2-minimal
|
2021-07-06 05:43:13 +02:00
|
|
|
cd /tmp && go install github.com/vbatts/git-validation@latest
|
2021-01-29 20:40:09 +01:00
|
|
|
|
|
|
|
- name: Build
|
2020-08-24 13:18:39 +02:00
|
|
|
working-directory: ./src/github.com/distribution/distribution
|
2021-01-29 20:40:09 +01:00
|
|
|
run: |
|
|
|
|
DCO_VERBOSITY=-q script/validate/dco
|
|
|
|
GO111MODULE=on script/setup/install-dev-tools
|
|
|
|
script/validate/vendor
|
|
|
|
go build -i .
|
|
|
|
make check
|
|
|
|
make build
|
|
|
|
make binaries
|
|
|
|
if [ "$GOOS" = "linux" ]; then make coverage ; fi
|
|
|
|
|
|
|
|
- uses: codecov/codecov-action@v1
|
|
|
|
with:
|
2020-08-24 13:18:39 +02:00
|
|
|
directory: ./src/github.com/distribution/distribution
|