Skip to content

Commit

Permalink
Fix CI issues
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
  • Loading branch information
Vladimir Popov committed Oct 1, 2020
1 parent bc1bb75 commit 2cfec38
Showing 1 changed file with 78 additions and 41 deletions.
119 changes: 78 additions & 41 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,33 @@ jobs:
go-version: 1.13.4
- run: |
go build -race ./...
# test:
# name: test
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-go@v1
# with:
# go-version: 1.13.4
# - name: Install gotestsum
# start: go get gotest.tools/gotestsum@v0.4.0
# - name: Run tests
# start: |
# eval $(go env)
# mkdir -p ~/junit/
# ${GOPATH}/bin/gotestsum --junitfile ~/junit/unit-tests.xml -- -race -short $(go list ./...)
# golangci-lint:
# name: golangci-lint
# runs-on: ubuntu-latest
# env:
# GOLANGCI_LINT_CONTAINER: golangci/golangci-lint:v1.23.2
# steps:
# - name: Check out code into the Go module directory
# uses: actions/checkout@v2
# - name: Pull golangci-lint docker container
# start: docker pull ${GOLANGCI_LINT_CONTAINER}
# - name: Run golangci-lint
# start: docker start --rm -v $(pwd):/app -w /app ${GOLANGCI_LINT_CONTAINER} golangci-lint start
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: 1.13.4
- name: Install gotestsum
run: go get gotest.tools/gotestsum@v0.4.0
- name: Run tests
run: |
eval $(go env)
mkdir -p ~/junit/
${GOPATH}/bin/gotestsum --junitfile ~/junit/unit-tests.xml -- -race -short $(go list ./...)
golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
env:
GOLANGCI_LINT_CONTAINER: golangci/golangci-lint:v1.23.2
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Pull golangci-lint docker container
run: docker pull ${GOLANGCI_LINT_CONTAINER}
- name: Run golangci-lint
run: docker run --rm -v $(pwd):/app -w /app ${GOLANGCI_LINT_CONTAINER} golangci-lint run

excludeFmtErrorf:
name: exclude fmt.Errorf
Expand All @@ -83,19 +83,19 @@ jobs:
exit 1
fi
done
# checkgomod:
# name: check go.mod and go.sum
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-go@v1
# with:
# go-version: 1.13.4
# - start: go mod tidy
# - name: Check for changes in go.mod or go.sum
# start: |
# git diff --name-only --exit-code go.mod || ( echo "Run go tidy" && false )
# git diff --name-only --exit-code go.sum || ( echo "Run go tidy" && false )
checkgomod:
name: check go.mod and go.sum
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: 1.13.4
- run: go mod tidy
- name: Check for changes in go.mod or go.sum
run: |
git diff --name-only --exit-code go.mod || ( echo "Run go tidy" && false )
git diff --name-only --exit-code go.sum || ( echo "Run go tidy" && false )
license:
name: license header check
runs-on: ubuntu-latest
Expand All @@ -105,8 +105,45 @@ jobs:
with:
go-version: 1.13.4
- name: Install go-header
run: 'go get github.com/denis-tingajkin/go-header@v0.2.1'
run: 'go get github.com/denis-tingajkin/go-header@v0.2.2'
- name: Run go-header
run: |
eval $(go env)
${GOPATH}/bin/go-header
excludereplace:
name: Exclude replace in go.mod
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v2
- name: Exclude replace in go.mod
run: |
grep -v 'replace github.com/satori/go.uuid' go.mod | grep ^replace || exit 0
exit 1
captureRunEnv:
name: Capture CI Run Env
runs-on: ubuntu-latest
steps:
- run: printenv
automerge:
name: automerge
runs-on: ubuntu-latest
needs:
- build
- test
if: github.actor == 'nsmbot' && github.base_ref == 'master' && github.event_name == 'pull_request'
steps:
- name: Check out the code
uses: actions/checkout@v2
- name: Fetch master
run: |
git remote -v
git fetch --depth=1 origin master
- name: Only allow go.mod and go.sum changes
run: |
find . -type f ! -name 'go.mod' ! -name 'go.sum' -exec git diff --exit-code origin/master -- {} +
- name: Automerge nsmbot PR
uses: ridedott/merge-me-action@master
with:
GITHUB_LOGIN: nsmbot
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 2cfec38

Please sign in to comment.