Skip to content

Commit

Permalink
updating CI again
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanmartins committed Nov 6, 2023
1 parent 68df856 commit 11b8d83
Showing 1 changed file with 33 additions and 50 deletions.
83 changes: 33 additions & 50 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ on:
workflow_dispatch:
push:
branches: [master]
paths:
"**.go"
paths: "**.go"
pull_request:
branches: [master]
paths:
"**.go"
paths: "**.go"

defaults:
run:
Expand All @@ -24,51 +22,36 @@ jobs:
name: CI
runs-on: ubuntu-latest
timeout-minutes: 10

steps:

- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Restore cached CI Dependencies
id: cache-ci-dependencies-restore
uses: actions/cache/restore@v3
with:
path: |
/usr/local/bin/gotestfmt
key: ${{ runner.os }}-ci-dependencies

- name: Install Go
id: cache-go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'



- name: Go mod download
if: steps.cache-go.outputs.cache-hit != 'true'
run: go mod download -x

- name: Go Build
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o /dev/null .

- name: Run tests
uses: GoTestTools/gotestfmt-action@v2
with:
version: v2.0.0
org: GoTestTools
repo: gotestfmt
run: |
set -euo pipefail
go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: "--timeout=2m"
skip-pkg-cache: true
skip-build-cache: true
skip-cache: true
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Go
id: cache-go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'

- name: Go mod download
if: steps.cache-go.outputs.cache-hit != 'true'
run: go mod download -x

- name: Go Build
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o /dev/null .

- name: Run tests
run: |
set -euo pipefail
go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: "--timeout=2m"
skip-pkg-cache: true
skip-build-cache: true
skip-cache: true

0 comments on commit 11b8d83

Please sign in to comment.