Skip to content

Commit

Permalink
Some CI simplification
Browse files Browse the repository at this point in the history
Signed-off-by: Ed Warnicke <hagbard@gmail.com>
  • Loading branch information
edwarnicke committed Sep 29, 2020
1 parent df36de1 commit b83ccf0
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 91 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
113 changes: 23 additions & 90 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,99 +8,38 @@ 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 .yamllint.yml --strict .
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
- name: yaml-lint
uses: ibiqlik/action-yamllint@v1
with:
go-version: 1.13.4
- run: |
go build -race ./...
build-osx:
name: build-osx
runs-on: macos-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/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 ./...)
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/gotestsum@v0.4.0
- 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
config_file: .ci/yamllint.yml
strict: true
build-and-test:
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
- name: Check out code
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/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 ./...)
- name: Build
run: go build -race ./...
- name: Test
run: go test -race ./...
golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
env:
GOLANGCI_LINT_CONTAINER: golangci/golangci-lint:v1.28.1
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:
version: v1.31

excludeFmtErrorf:
name: exclude fmt.Errorf
Expand Down Expand Up @@ -173,17 +112,11 @@ jobs:
run: |
grep ^replace go.mod || 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
- build-and-test
if: github.actor == 'nsmbot' && github.base_ref == 'master' && github.event_name == 'pull_request'
steps:
- name: Check out the code
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run:
tests: true
linters-settings:
goheader:
template-path: ".license/template.txt"
template-path: ".ci/license/template.txt"
values:
const:
year: 2020
Expand Down

0 comments on commit b83ccf0

Please sign in to comment.