Skip to content

Commit

Permalink
Merge branch 'main' into SAC-27-Club-Tags-CRUD
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettladley authored Feb 11, 2024
2 parents 4a324bb + ca7841b commit b0cd2f8
Show file tree
Hide file tree
Showing 123 changed files with 5,622 additions and 2,528 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@ jobs:
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
checks: write
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Enforce linting
run: |
cd ./backend/ && lint_output=$(go vet ./...)
if [[ -n "$lint_output" ]]; then
echo "$lint_output"
echo "::error::Linting issues found"
exit 1
fi
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
working-directory: ./backend/
test:
name: Test
runs-on: ubuntu-latest
Expand Down Expand Up @@ -96,9 +96,7 @@ jobs:
docker exec $CONTAINER_ID cat /var/lib/postgresql/data/postgresql.conf | grep max_connections
- name: Restart PostgreSQL Container
run: docker restart $(docker ps --filter "publish=5432" --format "{{.ID}}")
- name: Migrate DB
run: cd ./backend/src && go run main.go --only-migrate
- name: Run Tests with Coverage
run: cd ./backend/ && go test -benchmem -race -coverprofile=coverage.txt ./...
run: cd ./backend/ && go test -bench=. -benchmem -race -coverprofile=coverage.txt ./...
- name: Print Coverage
run: cd ./backend/ && go tool cover -func=coverage.txt
24 changes: 12 additions & 12 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ jobs:
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
checks: write
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Enforce linting
run: |
cd ./cli/ && lint_output=$(go vet ./...)
if [[ -n "$lint_output" ]]; then
echo "$lint_output"
echo "::error::Linting issues found"
exit 1
fi
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
working-directory: ./cli/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.DS_Store
.env
sac-cli
.vscode
.trunk
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [Node.js](https://nodejs.org/en/)
- [Yarn](https://yarnpkg.com/)
- [Go](https://golang.org/)
> Do not install through brew, use the official website
- [Docker](https://www.docker.com/)
- [PostgreSQL](https://www.postgresql.org/)
- Install through brew: `brew install postgresql@15`
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<br />

<div align="center">
<!-- Github Actions -->
<a href="https://goreportcard.com/report/github.com/GenerateNU/sac/backend">
<img src="https://goreportcard.com/badge/github.com/GenerateNU/sac/backend"
alt="Backend Go Report" />
</a>
<a href="https://github.com/GenerateNU/sac/actions/workflows/backend.yml">
<img src="https://github.com/GenerateNU/sac/actions/workflows/backend.yml/badge.svg"
alt="Backend Workflow Status" />
Expand All @@ -16,6 +19,10 @@

<br />

<a href="https://goreportcard.com/report/github.com/GenerateNU/sac/cli">
<img src="https://goreportcard.com/badge/github.com/GenerateNU/sac/cli"
alt="CLI Go Report" />
</a>
<a href="https://github.com/GenerateNU/sac/actions/workflows/cli.yml">
<img src="https://github.com/GenerateNU/sac/actions/workflows/cli.yml/badge.svg"
alt="CLI Workflow Status" />
Expand All @@ -41,6 +48,10 @@
</a>
</div>

## Repo Activity

![Repo Activity](https://repobeats.axiom.co/api/embed/0c57b86b156d377fcc75a6e482bf921acc8c550b.svg "Repobeats Analytics Image")

## Contributors

<div align="center">
Expand Down
23 changes: 23 additions & 0 deletions backend/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
linters:
enable:
- cyclop
- exportloopref
- gocritic
- gosec
- ineffassign
- misspell
- prealloc
- unconvert
- unparam
- goimports
- whitespace

linters-settings:
whitespace:
multi-func: true

issues:
exclude-rules:
- path: tests/api/helpers/
linters:
- cyclop
34 changes: 18 additions & 16 deletions backend/go.mod
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
module github.com/GenerateNU/sac/backend

go 1.21.1
go 1.22.0

require (
github.com/garrettladley/mattress v0.2.2
github.com/go-playground/validator/v10 v10.17.0
github.com/goccy/go-json v0.10.2
github.com/gofiber/fiber/v2 v2.52.0
github.com/gofiber/swagger v0.1.14
github.com/gofiber/swagger v1.0.0
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/google/uuid v1.6.0
github.com/huandu/go-assert v1.1.6
github.com/mcnijman/go-emailaddress v1.1.1
github.com/mitchellh/mapstructure v1.5.0
github.com/spf13/viper v1.18.2
github.com/swaggo/swag v1.16.2
gorm.io/driver/postgres v1.5.4
gorm.io/gorm v1.25.6
github.com/swaggo/swag v1.16.3
golang.org/x/crypto v0.19.0
golang.org/x/text v0.14.0
gorm.io/driver/postgres v1.5.6
gorm.io/gorm v1.25.7
)

require (
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/awnumar/memcall v0.2.0 // indirect
github.com/awnumar/memguard v0.22.4 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
Expand All @@ -27,10 +37,7 @@ require (
github.com/go-openapi/swag v0.19.15 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/goccy/go-json v0.10.2
github.com/google/uuid v1.6.0
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/huandu/go-assert v1.1.6
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgx/v5 v5.4.3 // indirect
Expand All @@ -40,15 +47,12 @@ require (
github.com/klauspost/compress v1.17.0 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mcnijman/go-emailaddress v1.1.1
github.com/mitchellh/mapstructure v1.5.0
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
Expand All @@ -62,11 +66,9 @@ require (
github.com/valyala/tcplisten v1.0.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.18.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0
golang.org/x/net v0.19.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/tools v0.13.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading

0 comments on commit b0cd2f8

Please sign in to comment.