From 015be459f35e30a1249fbdb413cefa60ca5017f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 14 Jul 2022 12:07:48 +0200 Subject: [PATCH] Move CI tests to GitHub Action --- .github/workflows/test.yml | 38 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 26 -------------------------- appveyor.yml | 9 ++------- 3 files changed, 40 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..dc975a9 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,38 @@ +on: + push: + branches: [ main ] + pull_request: +name: Test +jobs: + test: + strategy: + matrix: + go-version: [1.16.x,1.17.x,1.18.x] + # TODO(bep) fix windows-latest + platform: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.platform }} + steps: + - name: Install Go + uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.go-version }} + - name: Install staticcheck + if: matrix.go-version != '1.16.x' + run: go install honnef.co/go/tools/cmd/staticcheck@latest + shell: bash + - name: Update PATH + run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + shell: bash + - name: Checkout code + uses: actions/checkout@v1 + #- name: Fmt + # if: matrix.platform != 'windows-latest' # :( + # run: "diff <(gofmt -d .) <(printf '')" + # shell: bash + - name: Vet + run: go vet ./... + #- name: Staticcheck + # if: matrix.go-version != '1.16.x' + # run: staticcheck ./... + - name: Test + run: go test -race ./... \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e944f59..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -sudo: false -language: go -arch: - - amd64 - - ppc64e - -go: - - "1.14" - - "1.15" - - "1.16" - - tip - -os: - - linux - - osx - -matrix: - allow_failures: - - go: tip - fast_finish: true - -script: - - go build -v ./... - - go test -count=1 -cover -race -v ./... - - go vet ./... - - FILES=$(gofmt -s -l . zipfs sftpfs mem tarfs); if [[ -n "${FILES}" ]]; then echo "You have go format errors; gofmt your changes"; exit 1; fi diff --git a/appveyor.yml b/appveyor.yml index 5d2f34b..65e20e8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,3 +1,5 @@ +# This currently does nothing. We have moved to GitHub action, but this is kept +# until spf13 has disabled this project in AppVeyor. version: '{build}' clone_folder: C:\gopath\src\github.com\spf13\afero environment: @@ -6,10 +8,3 @@ build_script: - cmd: >- go version - go env - - go get -v github.com/spf13/afero/... - - go build -v github.com/spf13/afero/... -test_script: -- cmd: go test -count=1 -cover -race -v github.com/spf13/afero/...