Skip to content

Commit

Permalink
update github actions
Browse files Browse the repository at this point in the history
Signed-off-by: Dusan Malusev <[email protected]>
  • Loading branch information
CodeLieutenant committed May 10, 2024
1 parent edaa7f0 commit 7fa8960
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 19 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
name: 'GolangCI Lint'

on:
pull_request:
push:
branches:
- master
push:
pull_request:
branches:
- master

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-golangci-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-golangci-${{ hashFiles('**/go.sum') }}
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
golangci_lint_flags: "--tests=false"
golangci_lint_flags: "--config=.golangci.yml"
cache: true
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 'Create Release'

on:
push:
tags:
- 'v*'

jobs:
create_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Get Tag
if: startsWith(github.ref, 'refs/tags/v')
uses: olegtarasov/[email protected]
id: version_tag
with:
tagRegex: "v(.*)"
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
id: release
with:
name: "v${{ steps.version_tag.outputs.tag }}"
tag_name: "v${{ steps.version_tag.outputs.tag }}"
generate_release_notes: true
append_body: true
prerelease: false
fail_on_unmatched_files: true
- name: "Generate release changelog"
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
author: true
releaseUrl: ${{ steps.release.outputs.url }}
issues: false
pullRequests: true
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update CHANGELOG.md"
branch: master
commit_options: '--no-verify --signoff'
file_pattern: CHANGELOG.md
13 changes: 13 additions & 0 deletions .github/workflows/sec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
on: [push, pull_request]
name: Security
jobs:
Gosec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Gosec
uses: securego/gosec@master
with:
args: ./...
24 changes: 10 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Testing'
name: "Testing"

on:
push:
Expand All @@ -7,35 +7,31 @@ on:
pull_request:
branches:
- master

jobs:
test:
unit-tests:
strategy:
matrix:
os: [ubuntu-latest]
go: ['1.21']
runs-on: ${{ matrix.os }}
container: golang:${{ matrix.go }}-bullseye
go: ["1.22"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Install Task
uses: arduino/setup-task@v1
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: |
go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
task test
- uses: codecov/codecov-action@v3
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: unit-tests
name: codecov-umbrella
fail_ci_if_error: false
verbose: false
slug: nano-interactive/go-utils
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/nano-interactive/go-utils/v2

go 1.22

toolchain go1.22.2

require (
github.com/gocql/gocql v1.6.0
github.com/gofiber/fiber/v2 v2.52.4
Expand Down

0 comments on commit 7fa8960

Please sign in to comment.