From 5d18fd18259628468b29caef195999f5d12d46c6 Mon Sep 17 00:00:00 2001 From: Gabriela Cervantes Date: Mon, 4 Jan 2021 10:50:55 -0600 Subject: [PATCH] github: Enable github actions This PR enables github actions for the proxy repository. Fixes #293 Signed-off-by: Gabriela Cervantes --- .github/workflows/main.yml | 52 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 44 -------------------------------- 2 files changed, 52 insertions(+), 44 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 0000000..2ec4c73 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,52 @@ +on: ["pull_request"] +name: Static checks +jobs: + test: + strategy: + matrix: + go-version: [1.13.x, 1.14.x, 1.15.x] + os: [ubuntu-20.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: Install package dependencies + run: | + sudo apt-get update -qq + sudo apt-get install -y -qq automake moreutils + - name: Building + run: | + proxy_repo=$(go env GOPATH)/src/github.com/kata-containers/proxy + pushd ${proxy_repo} + GOPATH=$(go env GOPATH) make + - name: Running tests + run: | + proxy_repo=$(go env GOPATH)/src/github.com/kata-containers/proxy + pushd ${proxy_repo} + GOPATH=$(go env GOPATH) make test + - name: Running static checks + run: | + proxy_repo=$(go env GOPATH)/src/github.com/kata-containers/proxy + pushd ${proxy_repo} + GOPATH=$(go env GOPATH) .ci/static-checks.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e5a6530..0000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -# -# Copyright 2017 HyperHQ Inc. -# -# SPDX-License-Identifier: Apache-2.0 -# - -os: - - linux - - osx - - linux-ppc64le - -matrix: - include: - - os: linux - sudo: required - dist: xenial - allow_failures: - - os: osx - -language: go -go: - - 1.13.9 - -go_import_path: github.com/kata-containers/proxy - -env: - - target_branch=$TRAVIS_BRANCH - -before_script: - - ".ci/static-checks.sh" - -before_install: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq ; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y -qq automake moreutils ; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install bash; fi - -install: - - cd ${TRAVIS_BUILD_DIR} && make - -script: - - cd ${TRAVIS_BUILD_DIR} && make test - -after_success: - - bash <(curl -s https://codecov.io/bash)