mirror of https://github.com/spf13/afero.git
Move CI tests to GitHub Action
This commit is contained in:
parent
100c9a6d7b
commit
015be459f3
|
@ -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 ./...
|
26
.travis.yml
26
.travis.yml
|
@ -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
|
|
|
@ -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}'
|
version: '{build}'
|
||||||
clone_folder: C:\gopath\src\github.com\spf13\afero
|
clone_folder: C:\gopath\src\github.com\spf13\afero
|
||||||
environment:
|
environment:
|
||||||
|
@ -6,10 +8,3 @@ build_script:
|
||||||
- cmd: >-
|
- cmd: >-
|
||||||
go version
|
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/...
|
|
||||||
|
|
Loading…
Reference in New Issue