Skip to content

Commit

Permalink
Merge pull request #19 from estesp/github-action-ci
Browse files Browse the repository at this point in the history
Add GitHub Action-based CI workflow
  • Loading branch information
fuweid committed Mar 27, 2020
2 parents b45ef1f + 8d2749d commit 6eb0fcc
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,72 @@
name: Go

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:
name: Typeurl CI
runs-on: ubuntu-18.04
steps:

- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Setup Go binary path
shell: bash
run: |
echo "::set-env name=GOPATH::${{ github.workspace }}"
echo "::add-path::${{ github.workspace }}/bin"
- name: Check out code
uses: actions/checkout@v2
with:
path: src/github.com/containerd/typeurl
fetch-depth: 25

- name: Checkout project
uses: actions/checkout@v2
with:
repository: containerd/project
path: src/github.com/containerd/project

- name: Install dependencies
env:
GO111MODULE: off
run: |
go get -u github.com/vbatts/git-validation
go get -u github.com/kunalkushwaha/ltag
- name: Check DCO/whitespace/commit message
env:
GITHUB_COMMIT_URL: ${{ github.event.pull_request.commits_url }}
DCO_VERBOSITY: "-q"
DCO_RANGE: ""
working-directory: src/github.com/containerd/typeurl
run: |
if [ -z "${GITHUB_COMMIT_URL}" ]; then
DCO_RANGE=$(jq -r '.before +".."+ .after' ${GITHUB_EVENT_PATH})
else
DCO_RANGE=$(curl ${GITHUB_COMMIT_URL} | jq -r '.[0].parents[0].sha +".."+ .[-1].sha')
fi
../project/script/validate/dco
- name: Check file headers
run: ../project/script/validate/fileheader ../project/
working-directory: src/github.com/containerd/typeurl

- name: Test
working-directory: src/github.com/containerd/typeurl
run: |
go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Codecov
run: bash <(curl -s https://codecov.io/bash)
working-directory: src/github.com/containerd/typeurl

0 comments on commit 6eb0fcc

Please sign in to comment.