Skip to content

Commit

Permalink
feature: github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
abdahmed22 committed Aug 17, 2024
1 parent 5174e40 commit 98d0e78
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/Lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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: Lint

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

env:
GO_VERSION: '1.22.4'

jobs:

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: go get ./...


- name: Run linter
uses: golangci/[email protected]
with:
version: latest
36 changes: 36 additions & 0 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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: Format

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

env:
GO_VERSION: '1.22.4'

jobs:

fmt:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: go get ./...

- name: format
uses: Jerome1337/[email protected]

36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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: Test

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

env:
GO_VERSION: '1.22.4'

jobs:

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: go get ./...

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

0 comments on commit 98d0e78

Please sign in to comment.