From 92a892e7410d732bc6fde423c34bfda105e26d4c Mon Sep 17 00:00:00 2001 From: Gabriela Cervantes Date: Thu, 17 Dec 2020 16:13:40 -0600 Subject: [PATCH] github: Add github actions This PR enables the github actions for this repository. Fixes #193 Signed-off-by: Gabriela Cervantes --- .github/workflows/main.yml | 46 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 21 ----------------- 2 files changed, 46 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..888a973ec8 --- /dev/null +++ b/.github/workflows/main.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 38b6e496f2..0000000000 --- a/.travis.yml +++ /dev/null @@ -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"