Skip to content

Commit

Permalink
Add github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
pivaldi committed Oct 28, 2023
1 parent 3a0cc73 commit 97049ad
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: "1.20"
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.54
version: latest

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/gosec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: gosec

env:
GO_VERSION: "1.20"
on:
pull_request:
push:
branches: [main]

permissions:
contents: read

jobs:
gosec:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v3

- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: ./...
37 changes: 37 additions & 0 deletions .github/workflows/mod-verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: mod-verify

env:
GO_VERSION: "1.20"
on:
push:
branches:
- master
- main
pull_request:

permissions:
contents: read

jobs:
mod-verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Verify dependencies
run: go mod verify
38 changes: 38 additions & 0 deletions .github/workflows/staticcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: staticcheck

env:
GO_VERSION: "1.20"
on:
pull_request:
push:
branches: [main]

permissions:
contents: read

jobs:
staticcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest

- name: Run staticcheck
run: staticcheck ./...
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Go Nullable

[![golangci-lint](https://github.com/ovya/nullable/actions/workflows/golangci-lint.yml/badge.svg)](https://github.com/ovya/nullable/actions/workflows/golangci-lint.yml)

* Provide Go database null value for *any* data type thanks to the Golang generic features.
* Make possible to scan and store any structs' type into json and jsonb Postgresql data type.
* Support JSON marshaling and unMarshaling with conventional
Expand Down

0 comments on commit 97049ad

Please sign in to comment.