From 1b87dc48af63a1367488023882c2c552fc852185 Mon Sep 17 00:00:00 2001 From: TopiSenpai Date: Fri, 11 Feb 2022 14:15:38 +0100 Subject: [PATCH] update workflow --- .github/workflows/go.yml | 80 +++++++++++++++++++++++++++++----------- 1 file changed, 59 insertions(+), 21 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index dfef401..e3b0ee3 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,32 +1,70 @@ name: Go -on: - push: - branches: [ master, development ] - pull_request: - branches: [ master, development ] +on: [ push, pull_request ] jobs: + gobuild: + # We want to run on external PRs, but not on our own internal PRs as they'll be run + # by the push to the branch. + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 + + - name: go build + run: go build -v ./... + + govet: + # We want to run on external PRs, but not on our own internal PRs as they'll be run + # by the push to the branch. + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 + + - name: go vet + run: go vet -v ./... - testing: + gotest: + # We want to run on external PRs, but not on our own internal PRs as they'll be run + # by the push to the branch. + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.16 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 - - name: Build - run: go build -v ./... + - name: go test + env: + token: ${{ secrets.TOKEN }} + run: go test -v ./... + + gostaticcheck: + # We want to run on external PRs, but not on our own internal PRs as they'll be run + # by the push to the branch. + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 - - name: Test - env: - token: ${{ secrets.TOKEN }} - run: go test -v ./... + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 - - name: Lint - uses: Jerome1337/golint-action@v1.0.2 - with: - golint-path: './...' + - name: go staticcheck + uses: dominikh/staticcheck-action@v1.1.0