-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from edwarnicke/cisimple
Simplify CI
- Loading branch information
Showing
3 changed files
with
37 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,80 +9,22 @@ on: | |
- master | ||
jobs: | ||
build: | ||
name: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13.4 | ||
- run: | | ||
go build -race ./... | ||
build-win: | ||
name: build-win | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13.4 | ||
- run: | | ||
go build -race ./... | ||
build-osx: | ||
name: build-osx | ||
runs-on: macos-latest | ||
name: build-and-test | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v1 | ||
with: | ||
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 | ||
run: go get gotest.tools/[email protected] | ||
- name: Run tests | ||
run: | | ||
eval $(go env) | ||
mkdir -p ~/junit/ | ||
${GOPATH}/bin/gotestsum --junitfile ~/junit/unit-tests.xml -- -race -short $(go list ./...) | ||
test-win: | ||
name: test-win | ||
runs-on: windows-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/[email protected] | ||
- name: Run tests | ||
run: | | ||
$env:Path += ";$(go env GOPATH)\bin" | ||
mkdir $home/junit | ||
gotestsum --junitfile $home\junit\unit-tests.xml -- -race -short $(go list .\...) | ||
test-osx: | ||
name: test-osx | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v1 | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13.4 | ||
- name: Install gotestsum | ||
run: go get gotest.tools/[email protected] | ||
- name: Run tests | ||
run: | | ||
eval $(go env) | ||
mkdir -p ~/junit/ | ||
${GOPATH}/bin/gotestsum --junitfile ~/junit/unit-tests.xml -- -race -short $(go list ./...) | ||
- name: Build | ||
run: go build -race ./... | ||
- name: Test | ||
run: go test -race ./... | ||
golangci-lint: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
|
@@ -91,10 +33,11 @@ jobs: | |
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 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. | ||
version: v1.31 | ||
checkgomod: | ||
name: check go.mod and go.sum | ||
runs-on: ubuntu-latest | ||
|
@@ -107,20 +50,6 @@ jobs: | |
- name: Check for changes in go.mod or go.sum | ||
run: | | ||
git diff --name-only --exit-code $(ls -1 go.*) || ( echo "Run go tidy" && false ) | ||
license: | ||
name: license header check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13.4 | ||
- name: Install go-header | ||
run: 'go get github.com/denis-tingajkin/[email protected]' | ||
- name: Run go-header | ||
run: | | ||
eval $(go env) | ||
${GOPATH}/bin/go-header | ||
excludereplace: | ||
name: Exclude replace in go.mod | ||
runs-on: ubuntu-latest | ||
|
@@ -137,9 +66,8 @@ jobs: | |
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v1 | ||
- name: Install yamllint | ||
run: pip install --user yamllint | ||
- name: Run yamllint | ||
run: ~/.local/bin/yamllint -c .ci/yamllint.yml --strict . | ||
- name: yaml-lint | ||
uses: ibiqlik/action-yamllint@v1 | ||
with: | ||
config_file: .ci/yamllint.yml | ||
strict: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters