Skip to content

Commit

Permalink
Refactor: update GitHub actions.
Browse files Browse the repository at this point in the history
Signed-off-by: txaty <txaty@proton.me>
  • Loading branch information
txaty committed Nov 23, 2023
1 parent 3ab265a commit c486d90
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ on:
pull_request:
branches: [ "main" ]

env:
GO_VERSION: 1.21

jobs:

build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
go: [ '1.21' ]
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
go-version: ${{ env.GO_VERSION }}

- name: Cache Go modules
uses: actions/cache@v3
Expand All @@ -34,6 +34,7 @@ jobs:
run: make build

test:
name: Test
needs: build
runs-on: ubuntu-latest
steps:
Expand All @@ -42,21 +43,28 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: './go.mod'
go-version: ${{ env.GO_VERSION }}

- name: Test
- name: Unit Test with Mocking
run: make test_with_mock

lint:
name: Lint
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3

coverage:
name: Coverage
needs: lint
runs-on: ubuntu-latest
steps:
Expand All @@ -70,6 +78,7 @@ jobs:
if: success()

analysis:
name: Analysis
needs: coverage
runs-on: ubuntu-latest
steps:
Expand All @@ -86,4 +95,5 @@ jobs:
- uses: jidicula/go-fuzz-action@v1.1.0
with:
fuzz-time: 30s
fuzz-minimize-time: 1m
fuzz-minimize-time: 1m
go-version: ${{ env.GO_VERSION }}

0 comments on commit c486d90

Please sign in to comment.