Skip to content

Commit

Permalink
Up github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
demdxx committed Mar 20, 2023
1 parent f121325 commit 68f222d
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Tests

on:
push:
tags:
Expand All @@ -10,29 +12,34 @@ on:
- master
- main

name: run tests
concurrency:
group: ci-tests-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
go-version: 1.19.x
- name: Checkout code
uses: actions/checkout@v3
- name: Run linters
uses: golangci/golangci-lint-action@v3
with:
version: v1.48.0
version: v1.52.0
skip-cache: true
args: --fix

test:
if: github.event.pull_request.draft == false
needs: lint
strategy:
matrix:
go-version: [1.18.x, 1.19.x]
go-version: [1.19.x, 1.20.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand All @@ -47,12 +54,13 @@ jobs:
run: go test -v -covermode=count

coverage:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
needs: test
strategy:
fail-fast: false
matrix:
go-version: [1.18.x, 1.19.x]
go-version: [1.19.x, 1.20.x]
steps:
- uses: actions/setup-go@v3
with:
Expand All @@ -68,9 +76,10 @@ jobs:

# notifies that all test jobs are finished.
finish:
if: github.event.pull_request.draft == false
needs: coverage
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true
parallel-finished: true

0 comments on commit 68f222d

Please sign in to comment.