Skip to content

Commit

Permalink
feat: Add CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
LightningDev1 committed Feb 12, 2024
1 parent e345f1c commit 15aa992
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI Workflow
on: [push, pull_request]

permissions:
contents: read

jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ">=1.21.1"

- name: Check diff between gofmt and code
run: diff <(gofmt -d .) <(echo -n)

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

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ">=1.21.1"

- name: Run go vet
run: go vet -x ./...

- name: Run GolangCI-Lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54.2

test-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ">=1.21.1"

- name: Run tests
run: go test -v -race ./...

test-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ">=1.21.1"

- name: Run tests
run: go test -v -race ./...


test-macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ">=1.21.1"

- name: Run tests
run: go test -v -race ./...

0 comments on commit 15aa992

Please sign in to comment.