From a41b57e607bcebc25471bc8a42bbae5775dac70b Mon Sep 17 00:00:00 2001 From: Phil Estes Date: Mon, 26 Apr 2021 10:19:32 -0400 Subject: [PATCH] Migrate from Travis to GitHub Actions Signed-off-by: Phil Estes --- .github/workflows/ci.yml | 85 ++++++++++++++++++++++++++++++++++++++++ .golangci.yml | 22 +++++++++++ 2 files changed, 107 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .golangci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..32f9c5f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,85 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + checks: + name: Project Checks + runs-on: ubuntu-18.04 + timeout-minutes: 5 + + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.16.x + + - name: Set env + shell: bash + run: | + echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV + echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + + - uses: actions/checkout@v2 + with: + path: src/github.com/containerd/go-runc + fetch-depth: 25 + + - uses: containerd/project-checks@v1 + with: + working-directory: src/github.com/containerd/go-runc + + linters: + name: Linters + runs-on: ${{ matrix.os }} + timeout-minutes: 10 + + strategy: + matrix: + go-version: [1.16.x] + os: [ubuntu-18.04] + + steps: + - uses: actions/checkout@v2 + with: + path: src/github.com/containerd/go-runc + + - name: Set env + shell: bash + run: | + echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV + echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + + - uses: golangci/golangci-lint-action@v2 + with: + version: v1.29 + working-directory: src/github.com/containerd/go-runc + + tests: + name: Tests + runs-on: ubuntu-18.04 + timeout-minutes: 5 + + steps: + - uses: actions/checkout@v2 + with: + path: src/github.com/containerd/go-runc + + - uses: actions/setup-go@v2 + with: + go-version: 1.16.x + + - name: Set env + shell: bash + run: | + echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV + echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + + - run: | + go test -v -race -covermode=atomic -coverprofile=coverage.txt ./... + bash <(curl -s https://codecov.io/bash) + working-directory: src/github.com/containerd/go-runc diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..4cef1ca --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,22 @@ +linters: + enable: + - structcheck + - varcheck + - staticcheck + - unconvert + - gofmt + - goimports + - golint + - ineffassign + - vet + - unused + - misspell + disable: + - errcheck + +issues: + include: + - EXC0002 + +run: + timeout: 2m