Skip to content

Commit

Permalink
Create go.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoogle-ink committed May 25, 2023
1 parent 61cee29 commit d02c55a
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Run Tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18

- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v3.4.0
with:
version: v1.51.2
args: --verbose

test:
needs: lint
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
go: [ '1.18', '1.19', '1.20' ]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: Checkout Code
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}

- name: Test
run: go test -v ./...

0 comments on commit d02c55a

Please sign in to comment.