Skip to content

Commit

Permalink
Split workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
gruz0 committed May 13, 2024
1 parent 6b7eb12 commit 5362887
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 48 deletions.
82 changes: 34 additions & 48 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,62 +25,48 @@ jobs:
git diff --exit-code go.mod
git diff --exit-code go.sum
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: lint
uses: golangci/[email protected]
with:
version: latest

tests-on-windows:
needs: golangci-lint
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Run build
run: make.exe build
- name: Run tests
run: make.exe test

tests-on-macos:
needs: golangci-lint
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Run tests
run: make test

tests-on-unix:
needs: golangci-lint
runs-on: ubuntu-latest
strategy:
matrix:
golang:
- '1.21'
- '1.22'
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.golang }}
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.golang }}-
- name: Run tests
run: make test
# tests-on-macos:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v4
# - name: Install Go
# uses: actions/setup-go@v5
# with:
# go-version: ${{ env.GO_VERSION }}
# - name: Run tests
# run: make test
#
# tests-on-unix:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# golang:
# - '1.21'
# - '1.22'
# steps:
# - uses: actions/checkout@v4
# - name: Install Go
# uses: actions/setup-go@v5
# with:
# go-version: ${{ matrix.golang }}
# - uses: actions/cache@v4
# with:
# path: ~/go/pkg/mod
# key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }}
# restore-keys: |
# ${{ runner.os }}-go-${{ matrix.golang }}-
# - name: Run tests
# run: make test
24 changes: 24 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Original: https://github.com/golangci/golangci-lint/blob/master/.github/workflows/pr.yml
name: CI
on:
push:
branches:
- main
pull_request:

env:
GO_VERSION: '1.22'

jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: lint
uses: golangci/[email protected]
with:
version: latest

0 comments on commit 5362887

Please sign in to comment.