-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Frontend for landing page with embed Tests using mysql as driver
- Loading branch information
1 parent
3e5b3ac
commit a2e8daf
Showing
79 changed files
with
11,861 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
on: | ||
push: | ||
paths: | ||
- '**/*.go' | ||
- '**/*.mod' | ||
- '**/*.sum' | ||
- '**/*.yml' | ||
name: CI | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
go-version: [mod] | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: kevincobain2000/action-gobrew@v2 | ||
with: | ||
version: ${{ matrix.go-version }} | ||
- name: Setup Node.js ${{ matrix.node-versions }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Build Dist for Embed | ||
working-directory: app/frontend | ||
run: | | ||
npm install | ||
npm run build | ||
- name: Build | ||
working-directory: app | ||
run: go build main.go | ||
|
||
- name: Install Tools | ||
run: | | ||
go install github.com/securego/gosec/v2/cmd/gosec@latest | ||
- name: Lint | ||
working-directory: app | ||
run: | | ||
gosec ./... | ||
go vet -all . | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
on: | ||
pull_request: | ||
paths: | ||
- '**/*.go' | ||
- '**/*.mod' | ||
- '**/*.sum' | ||
- '**/*.yml' | ||
push: | ||
paths: | ||
- '**/*.go' | ||
- '**/*.mod' | ||
- '**/*.sum' | ||
- '**/*.yml' | ||
|
||
name: "Cover It Up" | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
jobs: | ||
coveritup: | ||
strategy: | ||
matrix: | ||
go-version: [mod] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: kevincobain2000/action-gobrew@v2 | ||
with: | ||
version: ${{ matrix.go-version }} | ||
- name: Setup Node.js ${{ matrix.node-versions }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install Tools | ||
run: | | ||
go install github.com/securego/gosec/v2/cmd/gosec@latest | ||
go install github.com/axw/gocov/gocov@latest | ||
go install github.com/AlekSi/gocov-xml@latest | ||
- name: Setup Node.js ${{ matrix.node-versions }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 20 | ||
- uses: mirromutth/[email protected] | ||
with: | ||
mysql version: '8.0' | ||
mysql database: 'coverituptest' | ||
- name: test | ||
run: | | ||
go test ./... -count=1 | ||
# - name: NPM Install | ||
# working-directory: app/frontend | ||
# run: | | ||
# START=$SECONDS | ||
# npm install | ||
# echo SCORE=$(($SECONDS-START)) >> "$GITHUB_ENV" | ||
# - uses: kevincobain2000/action-coveritup@v1 | ||
# with: | ||
# type: npm-install-time | ||
|
||
# - name: NPM Build | ||
# working-directory: app/frontend | ||
# run: | | ||
# START=$SECONDS | ||
# npm run build | ||
# echo SCORE=$(($SECONDS-START)) >> "$GITHUB_ENV" | ||
# - uses: kevincobain2000/action-coveritup@v1 | ||
# with: | ||
# type: npm-build-time | ||
|
||
# - name: Go Build | ||
# working-directory: app | ||
# run: | | ||
# START=$SECONDS | ||
# go build -ldflags '-s -w' -o main main.go | ||
# echo SCORE=$(($SECONDS-START)) >> "$GITHUB_ENV" | ||
# - uses: kevincobain2000/action-coveritup@v1 | ||
# with: | ||
# type: go-build-time | ||
|
||
# - name: Test | ||
# working-directory: app | ||
# run: | | ||
# START=$SECONDS | ||
# go test -race -v ./... -count=1 -coverprofile=coverage.out | ||
# echo SCORE=$(($SECONDS-START)) >> "$GITHUB_ENV" | ||
# - uses: kevincobain2000/action-coveritup@v1 | ||
# with: | ||
# type: unit-test-run-time | ||
|
||
# - name: Coverage | ||
# working-directory: app | ||
# run: | | ||
# go tool cover -html=coverage.out -o coverage.html | ||
# gocov convert coverage.out | gocov-xml > coverage.xml | ||
# - name: Coveritup | ||
# run: | | ||
# curl -sLk https://raw.githubusercontent.com/kevincobain2000/cover-totalizer/master/install.sh | sh | ||
# echo SCORE=`./cover-totalizer coverage.xml` >> "$GITHUB_ENV" | ||
# - uses: kevincobain2000/action-coveritup@v1 | ||
# with: | ||
# type: coverage | ||
|
||
# - name: Go Binary Size | ||
# working-directory: app | ||
# run: | | ||
# echo SCORE=`du -sk main | awk '{print $1}'` >> "$GITHUB_ENV" | ||
# - uses: kevincobain2000/action-coveritup@v1 | ||
# with: | ||
# type: go-binary-size | ||
|
||
# - name: Number of dependencies | ||
# working-directory: app | ||
# run: echo SCORE=`go list -m all|wc -l|awk '{$1=$1};1'` >> "$GITHUB_ENV" | ||
# - uses: kevincobain2000/action-coveritup@v1 | ||
# with: | ||
# type: go-mod-dependencies | ||
|
||
# - name: Number of GO Sec issues | ||
# working-directory: app | ||
# run: echo SCORE=`gosec -no-fail --quiet ./...|grep Issues | tail -1 |awk '{print $3}'` >> "$GITHUB_ENV" | ||
# - uses: kevincobain2000/action-coveritup@v1 | ||
# with: | ||
# type: go-sec-issues | ||
|
||
# - uses: kevincobain2000/action-coveritup@v1 | ||
# with: | ||
# pr_comment: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: kevincobain2000/action-gobrew@v2 | ||
with: | ||
version: 'mod' | ||
- name: Setup Node.js ${{ matrix.node-versions }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Build Dist for Embed | ||
working-directory: app/frontend | ||
run: | | ||
npm install | ||
npm run build | ||
echo "You are running MIT License version" > dist/index.html | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v3 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean --skip-validate | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- | ||
main: ./app/main.go | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- darwin | ||
# - windows | ||
- freebsd | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
- arm | ||
ignore: | ||
- goos: windows | ||
goarch: arm64 | ||
- goos: freebsd | ||
goarch: arm64 | ||
- goos: windows | ||
goarch: arm | ||
- goos: freebsd | ||
goarch: arm | ||
- goos: darwin | ||
goarch: arm | ||
archives: | ||
- | ||
format: binary | ||
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}" | ||
snapshot: | ||
name_template: "{{ incpatch .Version }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
- '^bin' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# .air.conf | ||
# Config file for [Air](https://github.com/cosmtrek/air) in TOML format | ||
|
||
# Working directory | ||
# . or absolute path, please note that the directories following must be under root. | ||
root = "." | ||
tmp_dir = "tmp" | ||
|
||
[build] | ||
# Just plain old shell command. You could use `make` as well. | ||
cmd = "go mod tidy && go build -o ./tmp/main main.go" | ||
# Binary file yields from `cmd`. | ||
bin = "tmp/main" | ||
# Customize binary. | ||
full_bin = "PP_USER=air ./tmp/main" | ||
# Watch these filename extensions. | ||
include_ext = ["go", "tpl", "tmpl", "html", "env", "conf"] | ||
# Ignore these filename extensions or directories. | ||
exclude_dir = ["assets", "tmp", "vendor", "dist", "node_modules", "public", "frontend"] | ||
# Watch these directories if you specified. | ||
include_dir = [] | ||
# Exclude files. | ||
exclude_file = [] | ||
# It's not necessary to trigger build each time file changes if it's too frequent. | ||
delay = 1000 # ms | ||
# Stop to run old binary when build errors occur. | ||
stop_on_error = true | ||
# This log file places in your tmp_dir. | ||
log = "air_errors.log" | ||
|
||
[log] | ||
# Show log time | ||
time = false | ||
|
||
[color] | ||
# Customize each part's color. If no color found, use the raw app log. | ||
main = "magenta" | ||
watcher = "cyan" | ||
build = "yellow" | ||
runner = "green" | ||
|
||
[misc] | ||
# Delete tmp directory on exit | ||
clean_on_exit = true |
Oops, something went wrong.