Skip to content

Commit

Permalink
ci: improved ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Oudwins committed Oct 7, 2024
1 parent ad7c922 commit 986ac78
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 20 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: ci

on:
push:
branches: "**"
pull_request:
branches: "**"
workflow_dispatch:

jobs:
test:
strategy:
matrix:
go-version: [1.21.x, 1.22.x]
os: [ubuntu-latest]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
# - name: Set up Make
# run: sudo apt-get install make
- name: Run tests
#run: make test
run: go test ./...
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
20 changes: 0 additions & 20 deletions .github/workflows/test.yaml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/testCoverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Coverage

on:
push:
branches: [master]
workflow_dispatch:

jobs:
coverage:
strategy:
matrix:
go-version: [1.21.x, 1.22.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Test
run: go test -race -covermode=atomic -coverprofile="profile.cov" ./...

- name: Send Coverage
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.22.x'
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov

0 comments on commit 986ac78

Please sign in to comment.