From 0fb409dbde8b62f8ab94d32640ea9c334f8bd3d9 Mon Sep 17 00:00:00 2001 From: Gabriela Cervantes Date: Thu, 17 Dec 2020 13:12:51 -0600 Subject: [PATCH] github: Add github actions This PR enables the github actions for runtime repository. Fixes #3107 Signed-off-by: Gabriela Cervantes --- .github/workflows/main.yml | 60 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 41 -------------------------- 2 files changed, 60 insertions(+), 41 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..a608841c2d --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,60 @@ +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: Install package dependencies + run: | + sudo apt-get update -qq + sudo apt-get install -y -qq automake moreutils + - name: Versions checker + run: | + runtime_repo=$(go env GOPATH)/src/github.com/kata-containers/runtime + pushd ${runtime_repo} + GOPATH=$(go env GOPATH) .ci/versions_checker.sh + - name: Install yq + run: | + runtime_repo=$(go env GOPATH)/src/github.com/kata-containers/runtime + pushd ${runtime_repo} + GOPATH=$(go env GOPATH) .ci/install-yq.sh + - name: Building + run: | + runtime_repo=$(go env GOPATH)/src/github.com/kata-containers/runtime + pushd ${runtime_repo} + GOPATH=$(go env GOPATH) make + - name: Installing + run: | + runtime_repo=$(go env GOPATH)/src/github.com/kata-containers/runtime + pushd ${runtime_repo} + GOPATH=$(go env GOPATH) sudo -E PATH=$PATH make install diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9d77c5f704..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -# -# Copyright (c) 2018 Intel Corporation -# Copyright (c) 2018 IBM -# -# SPDX-License-Identifier: Apache-2.0 -# - -dist: xenial - -language: go -go: - - 1.13.9 - -os: - - linux - - linux-ppc64le - -jobs: - allow_failures: - - os: linux-ppc64le - -go_import_path: github.com/kata-containers/runtime - -env: - - target_branch=$TRAVIS_BRANCH - -before_install: - - git remote set-branches --add origin "${TRAVIS_BRANCH}" - - git fetch - - ".ci/setup.sh" - - ".ci/versions_checker.sh" - -before_script: - - ".ci/static-checks.sh" - - ".ci/versions_checker.sh" - -install: - - cd ${TRAVIS_BUILD_DIR} - - ".ci/install-yq.sh" - - make - - sudo -E PATH=$PATH make install