From 64874d17b18b53aeaf9eae3a66b5d22ce2a1d332 Mon Sep 17 00:00:00 2001 From: Chris Patterson Date: Fri, 29 Jan 2021 14:40:09 -0500 Subject: [PATCH] First draft of actions based ci Signed-off-by: Chris Patterson --- .github/workflows/ci.yml | 54 +++++++++++++++++++++++++++++++++++++ .github/workflows/dummy.yml | 14 ---------- script/validate/dco | 2 +- 3 files changed, 55 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/dummy.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..96921899 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + + build: + runs-on: ubuntu-latest + 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) || github.sha }} + + steps: + - uses: actions/checkout@v2 + with: + path: src/github.com/docker/distribution + fetch-depth: 50 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14.* + + - name: Dependencies + run: | + sudo apt-get -q update + sudo -E apt-get -yq --no-install-suggests --no-install-recommends install python-minimal + cd /tmp && go get -u github.com/vbatts/git-validation + + - name: Build + working-directory: ./src/github.com/docker/distribution + 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: + directory: ./src/github.com/docker/distribution \ No newline at end of file diff --git a/.github/workflows/dummy.yml b/.github/workflows/dummy.yml deleted file mode 100644 index 5a162715..00000000 --- a/.github/workflows/dummy.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: dummy - -on: - workflow_dispatch: - push: - pull_request: - -jobs: - dummy: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 diff --git a/script/validate/dco b/script/validate/dco index fb68620a..be96b3a8 100755 --- a/script/validate/dco +++ b/script/validate/dco @@ -9,4 +9,4 @@ if ! command -v git-validation; then fi verbosity="${DCO_VERBOSITY--v}" -GIT_CHECK_EXCLUDE="./vendor:./script/validate/template" git-validation "$verbosity" -run DCO,short-subject,dangling-whitespace +GIT_CHECK_EXCLUDE="./vendor:./script/validate/template" git-validation "$verbosity" -range "$COMMIT_RANGE" -run DCO,short-subject,dangling-whitespace \ No newline at end of file