Skip to content

Commit

Permalink
Merge pull request #30 from blinklabs-io/ci/update-golangci-lint
Browse files Browse the repository at this point in the history
ci: update golangci-lint and split go-test to separate workflow
  • Loading branch information
agaffney authored Oct 13, 2023
2 parents 1194ca4 + 41a22f7 commit 56c1699
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 14 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: go-test

on:
push:
tags:
- v*
branches:
- main
pull_request:

jobs:
go-test:
name: go-test
strategy:
matrix:
go-version: [1.20.x, 1.21.x]
# XXX: is it actually useful to run unit tests on macOS?
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: go-test
run: go test ./...
26 changes: 12 additions & 14 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
# This file was copied from the following URL and modified:
# https://github.com/golangci/golangci-lint-action/blob/master/README.md#how-to-use

name: golangci
name: golangci-lint
on:
push:
tags:
- v*
branches:
- main
pull_request:

permissions:
contents: read
pull-requests: read

jobs:
golangci:
name: lint
strategy:
matrix:
go-version: [1.20.x, 1.21.x]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v3
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
go-version: 1.21.x
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.53.3 # current version at time of commit
args: --timeout 10m
only-new-issues: true
- name: go-test
run: go test ./...
version: v1.54 # current version at time of commit
args: --timeout=10m
# Only show new issues in a PR but show all issues for pushes
only-new-issues: ${{ github.event_name == 'pull_request' && 'true' || 'false' }}

0 comments on commit 56c1699

Please sign in to comment.