github: Add github actions

This PR enables the github actions for this repository.

Fixes #193

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
This commit is contained in:
Gabriela Cervantes 2020-12-17 16:13:40 -06:00
parent 47959354dd
commit 92a892e741
2 changed files with 46 additions and 21 deletions

46
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,46 @@
on: ["pull_request"]
name: Static checks
jobs:
test:
strategy:
matrix:
go-version: [1.13.x, 1.14.x, 1.15.x]
os: [ubuntu-18.04]
runs-on: ${{ matrix.os }}
env:
GO111MODULE: off
TRAVIS: "true"
TRAVIS_BRANCH: ${{ github.base_ref }}
TRAVIS_PULL_REQUEST_BRANCH: ${{ github.head_ref }}
TRAVIS_PULL_REQUEST_SHA : ${{ github.event.pull_request.head.sha }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Setup GOPATH
run: |
gopath_org=$(go env GOPATH)/src/github.com/kata-containers/
mkdir -p ${gopath_org}
ln -s ${PWD} ${gopath_org}
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"
echo "TRAVIS_PULL_REQUEST_BRANCH: ${TRAVIS_PULL_REQUEST_BRANCH}"
echo "TRAVIS_PULL_REQUEST_SHA: ${TRAVIS_PULL_REQUEST_SHA}"
echo "TRAVIS: ${TRAVIS}"
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup travis references
run: |
echo "TRAVIS_BRANCH=${TRAVIS_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = \"/\" } ; { print $3 }')}"
- name: Setup
run: |
community_repo=$(go env GOPATH)/src/github.com/kata-containers/community
pushd ${community_repo}
GOPATH=$(go env GOPATH) .ci/setup.sh
- name: Running static checks
run: |
community_repo=$(go env GOPATH)/src/github.com/kata-containers/community
pushd ${community_repo}
GOPATH=$(go env GOPATH) .ci/static-checks.sh

View File

@ -1,21 +0,0 @@
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
dist: xenial
language: go
go:
- master
before_install:
- ".ci/setup.sh"
before_script:
- ".ci/static-checks.sh"
script:
- ".ci/run.sh"