diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..b1642f96d7 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,56 @@ +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: | + agent_repo=$(go env GOPATH)/src/github.com/kata-containers/agent + pushd ${agent_repo} + GOPATH=$(go env GOPATH) .ci/setup.sh + - name: Building + run: | + agent_repo=$(go env GOPATH)/src/github.com/kata-containers/agent + pushd ${agent_repo} + GOPATH=$(go env GOPATH) make + - name: Running tests + run: | + agent_repo=$(go env GOPATH)/src/github.com/kata-containers/agent + pushd ${agent_repo} + GOPATH=$(go env GOPATH) make test + - name: Running static checks + run: | + agent_repo=$(go env GOPATH)/src/github.com/kata-containers/agent + pushd ${agent_repo} + GOPATH=$(go env GOPATH) .ci/static-checks.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2cc6af766e..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -# -# Copyright 2017 HyperHQ Inc. -# -# SPDX-License-Identifier: Apache-2.0 -# - -sudo: required -dist: xenial - -os: - - linux - - linux-ppc64le - -language: go -go_import_path: github.com/kata-containers/agent - -env: - - target_branch=$TRAVIS_BRANCH - -before_install: - - ".ci/setup.sh" - -before_script: - - ".ci/install_go.sh" - - ".ci/static-checks.sh" - -install: - - cd ${TRAVIS_BUILD_DIR} && make - -script: - - cd ${TRAVIS_BUILD_DIR} && make test - -after_success: - - bash <(curl -s https://codecov.io/bash)