Skip to content

Commit

Permalink
feat: Import skeleton app from kevinrobayna/rotabot (#2)
Browse files Browse the repository at this point in the history
Rewrote the skeleton app deciding to use goa as it's the nicest way to
express the api.

Additionally i ended up using [sqlc](https://sqlc.dev) with good old
migrations as it's very clear what the query will be once its run
(instead of relaying on ORMs)

Finally, for specs we are going to be using
[ginkgo](https://onsi.github.io/ginkgo/#top) +
[gomega](https://onsi.github.io/gomega/) the sweet port of
[RSpec](https://rspec.info/) to go to be able to explain what the
expects do (also we get the sweet beforeEach back)

There are other minor differences but they don't really make sense to
note them
  • Loading branch information
kevinrobayna authored Jul 23, 2023
1 parent 88aa34f commit 092d03f
Show file tree
Hide file tree
Showing 75 changed files with 4,749 additions and 21 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly

- package-ecosystem: gomod
directory: /
schedule:
interval: weekly
69 changes: 69 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: build

permissions: {} # no need any permissions

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 10 * * 1' # run "At 10:00 on Monday"
workflow_call:

jobs:
run:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true
matrix:
# There's currently an issue with 1.20.6 and testcontainers
go: ['1.20.5']

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
check-latest: true

- name: Go Format
run: gofmt -s -w . && git diff --exit-code

- name: Go Vet
run: go vet ./...

- name: Go Tidy
run: go mod tidy && git diff --exit-code

- name: Go Mod
run: go mod download

- name: Go Mod Verify
run: go mod verify

- name: Go Build
run: make build

- name: Go Test
run: make test

- name: Upload Coverage
uses: codecov/codecov-action@v3
continue-on-error: true
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./cover.profile
fail_ci_if_error: false

- name: Test Summary
uses: test-summary/action@v2
with:
paths: |
report.xml
if: always()
34 changes: 34 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: lint

permissions: {} # no need any permissions

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_call:

jobs:
run:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
check-latest: true

- name: Lint
uses: golangci/[email protected]
with:
version: latest
args: --timeout 5m
36 changes: 36 additions & 0 deletions .github/workflows/vuln.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: vuln

permissions: {} # no need any permissions

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 10 * * 1' # run "At 10:00 on Monday"
workflow_call:

jobs:
run:
name: Vuln
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true

steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
check-latest: true

- name: Checkout
uses: actions/checkout@v3

- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest

- name: Run govulncheck
run: govulncheck -test ./...
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
bin/

report.xml
cover.profile

# Created by https://www.toptal.com/developers/gitignore/api/go
# Edit at https://www.toptal.com/developers/gitignore?templates=go

### Go ###
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work

# End of https://www.toptal.com/developers/gitignore/api/go
Loading

0 comments on commit 092d03f

Please sign in to comment.