Skip to content

Commit

Permalink
feat: Adding github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
RawanMostafa08 committed Sep 9, 2024
1 parent 0a7a12e commit dd0b957
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Go CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Build
run: go build -v ./...


checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.22'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.56.0
args: --timeout 3m
- name: Go Format
uses: Jerome1337/gofmt-action@v1.0.5
with:
gofmt-path: './src'
gofmt-flags: '-l -d'
- name: Test with the Go CLI
run: go test

32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: goreleaser

on:
push:
tags:
- v*


jobs:
goreleaser:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: "true"

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6.0.0
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit dd0b957

Please sign in to comment.