diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000000..0efab36231 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,50 @@ +name: 'push' + +on: [push, pull_request] + +jobs: + + test: + strategy: + matrix: + os: [ ubuntu, windows, macOS ] + go: [ 1.12.x, 1.13.x ] + + runs-on: ${{ matrix.os }}-latest + + steps: + + - name: Setup go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go }} + + - run: go get -v github.com/kyoh86/richgo@v0.3.3 + env: + GO111MODULE: on + + - uses: actions/checkout@v1 + + - name: run tests + shell: bash + run: $HOME/go/bin/richgo test -v ./... + env: + GO111MODULE: on + + - name: check formatting + if: matrix.os != 'windows' + run: diff -u <(echo -n) <(gofmt -d -s .) + + - name: build + run: | + cd cobra + go build + env: + GO111MODULE: on + + - name: go vet + if: matrix.os != 'windows' + run: | + if [ -z $NOVET ]; then + diff -u <(echo -n) <(go vet . 2>&1 | grep -vE 'ExampleCommand|bash_completions.*Fprint'); + fi