summaryrefslogtreecommitdiffstats
path: root/.github/workflows/ci.yml
blob: 085a632b3d689a04f820c9919a3366c0a2b2bb86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Continuous Integration

on: push

jobs:
  ci:
    runs-on: ubuntu-latest
    container:
      image: golang:1.14
    env:
      GOFLAGS: -mod=vendor
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Run gofmt -s
        run: |
          if [ $(find . ! -path "./vendor/*" -name "*.go" -exec gofmt -s -d {} \;|wc -l) -gt 0 ]; then
           find . ! -path "./vendor/*" -name "*.go" -exec gofmt -s -d {} \;
           exit 1;
          fi
      - name: Run tests
        run: |
          ./test.sh
      - name: Push on codecov result
        uses: codecov/codecov-action@v1
      - name: Run golangci-lint
        continue-on-error: true
        uses: actions-contrib/golangci-lint@v1
      - name: Compile project on every platform
        run: |
          go get github.com/mitchellh/gox
          gox -parallel 4 -os "linux freebsd netbsd windows" -osarch "darwin/i386 darwin/amd64"