Skip to content

Commit 7affc6b

Browse files
committed
feat: publish project
0 parents  commit 7affc6b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+9407
-0
lines changed

.cz.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
commitizen:
3+
name: cz_conventional_commits
4+
tag_format: v$version
5+
update_changelog_on_bump: true
6+
version: 0.0.1
7+
version_scheme: semver

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
go.sum linguist-generated

.github/dependabot.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
day: "monday"
8+
time: "06:00" # 9 am in romania
9+
commit-message:
10+
prefix: "build(deps)"
11+
reviewers:
12+
- "adrianbrad"
13+
14+
- package-ecosystem: github-actions
15+
directory: "/"
16+
schedule:
17+
interval: weekly
18+
day: "monday"
19+
time: "06:00" # 9 am in romania
20+
commit-message:
21+
prefix: "build(deps)"
22+
reviewers:
23+
- "adrianbrad"

.github/workflows/codeql.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: codeql
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [ main ]
9+
schedule:
10+
- cron: '0 0 1 * *' # once a month
11+
12+
jobs:
13+
analyze:
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
# required for all workflows
18+
security-events: write
19+
# only required for workflows in private repositories
20+
contents: read
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
# Initializes the CodeQL tools for scanning.
27+
- name: Initialize CodeQL
28+
uses: github/codeql-action/init@v2
29+
with:
30+
languages: go
31+
32+
- name: Autobuild
33+
uses: github/codeql-action/autobuild@v2
34+
35+
- name: Perform CodeQL Analysis
36+
uses: github/codeql-action/analyze@v2

.github/workflows/gitleaks.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: gitleaks
2+
on:
3+
- pull_request
4+
- push
5+
- workflow_dispatch
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
scan:
12+
name: gitleaks
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: gitleaks/gitleaks-action@v2
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/grype.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: grype
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
schedule:
7+
- cron: '0 0 1 * *' # once a month
8+
9+
jobs:
10+
scan-source:
11+
name: scan-source
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
security-events: write
16+
actions: read
17+
contents: read
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: anchore/scan-action@v3
22+
with:
23+
path: "."
24+
fail-build: true

.github/workflows/lint-test.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: lint-test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
schedule:
8+
- cron: '0 0 1 * *' # once a month
9+
10+
concurrency:
11+
group: "lint-test"
12+
13+
permissions:
14+
contents: read # for actions/checkout to fetch code
15+
pull-requests: read # for to fetching pull requests
16+
17+
jobs:
18+
lint:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Install Go
25+
uses: actions/setup-go@v4
26+
with:
27+
go-version: stable
28+
29+
- name: Lint
30+
uses: golangci/golangci-lint-action@v3
31+
with:
32+
version: latest
33+
args: --timeout 5m
34+
35+
test:
36+
runs-on: ${{ matrix.os }}
37+
strategy:
38+
matrix:
39+
os:
40+
- ubuntu-latest
41+
- macos-latest
42+
# - macos-latest-xlarge
43+
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@v4
47+
48+
- name: Install Go
49+
uses: actions/setup-go@v4
50+
with:
51+
go-version: stable
52+
53+
- name: Install Docker (mac)
54+
if: runner.os == 'macos'
55+
run: |
56+
brew install docker
57+
colima start
58+
59+
# For testcontainers to find the Colima socket
60+
# https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
61+
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
62+
63+
- name: Run Tests
64+
run: |
65+
go test -mod=mod -shuffle=on -race -timeout 300s ./...

.github/workflows/release.yaml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v[0-9]+.[0-9]+.[0-9]+"
7+
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
8+
- "v[0-9]+.[0-9]+.[0-9]+-beta[0-9]+"
9+
- "v[0-9]+.[0-9]+.[0-9]+-alpha[0-9]+"
10+
11+
permissions:
12+
contents: write
13+
14+
concurrency:
15+
group: "lint-test"
16+
cancel-in-progress: true
17+
18+
jobs:
19+
# Lint go source code.
20+
lint:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Install Go
27+
uses: actions/setup-go@v4
28+
with:
29+
go-version: stable
30+
31+
- name: Run Go linters
32+
uses: golangci/golangci-lint-action@v3
33+
with:
34+
version: latest
35+
args: --timeout 5m
36+
37+
# Run unit tests.
38+
test:
39+
runs-on: ${{ matrix.os }}
40+
strategy:
41+
matrix:
42+
os: [ ubuntu-latest, macos-latest ]
43+
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@v4
47+
48+
- name: Install Go
49+
uses: actions/setup-go@v4
50+
with:
51+
go-version: stable
52+
53+
- name: Install Docker (mac)
54+
if: runner.os == 'macos'
55+
run: |
56+
brew install docker
57+
colima start
58+
59+
# For testcontainers to find the Colima socket
60+
# https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
61+
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
62+
63+
- name: Run Tests
64+
run: |
65+
go test -mod=mod -shuffle=on -race -timeout 300s ./...
66+
67+
release:
68+
runs-on: ubuntu-latest
69+
needs: [lint, test]
70+
steps:
71+
- name: Checkout code
72+
uses: actions/checkout@v4
73+
with:
74+
fetch-depth: 0
75+
76+
- name: Fetch all tags
77+
run: git fetch --force --tags
78+
79+
- name: Install Go
80+
uses: actions/setup-go@v4
81+
with:
82+
go-version: stable
83+
84+
- name: Run GoReleaser for release
85+
uses: goreleaser/goreleaser-action@v5
86+
with:
87+
distribution: goreleaser
88+
version: latest
89+
args: release --debug --clean
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.DS_Store
2+
/.idea/
3+
/.vscode/
4+
postgres-data/
5+
key.json
6+
coverage.txt
7+
db_pass.txt
8+
.pgpass
9+
coverage.out
10+
coverage.xml
11+
dist/

0 commit comments

Comments
 (0)