Skip to content

Commit

Permalink
Merge pull request #114 from linycken013127/dev
Browse files Browse the repository at this point in the history
v0.2.0 Release
  • Loading branch information
linycken013127 authored Feb 18, 2024
2 parents 7a89308 + e0a140a commit ef87a39
Show file tree
Hide file tree
Showing 78 changed files with 3,425 additions and 509 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
; https://editorconfig.org/

root = true

[*]
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[{Makefile,go.mod,go.sum,*.go,.gitmodules}]
indent_style = tab
indent_size = 4

[*.md]
indent_size = 4
trim_trailing_whitespace = false

[Dockerfile]
indent_size = 4
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Treat all files in the Go repo as binary, with no git magic updating
# line endings. This produces predictable results in different environments.
#
# Windows users contributing to Go will need to use a modern version
# of git and editors capable of LF line endings.
#
# Windows .bat files are known to have multiple bugs when run with LF
# endings, and so they are checked in with CRLF endings, with a test
# in test/winbatch.go to catch problems. (See golang.org/issue/37791.)
#
# We'll prevent accidental CRLF line endings from entering the repo
# via the git-codereview gofmt checks and tests.
#
# See golang.org/issue/9281.

* -text
*.go eol=lf diff=golang
*.ts diff=typescript
*.tsx diff=typescript
*.json diff=json
*.sql diff=sql
*.md text diff=markdown
26 changes: 21 additions & 5 deletions .github/workflows/test-go-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- .github/workflows/test-go-unit.yml

env:
GO_VERSION: 1.21
GO_VERSION: 1.22

jobs:
build:
Expand All @@ -30,6 +30,13 @@ jobs:
working-directory: ./Backend
run: cp env .env

- name: Install dependencies
working-directory: ./Backend
run: |
go mod tidy
go mod download
go mod vendor
- name: Build
working-directory: ./Backend
run: go build -v ./...
Expand Down Expand Up @@ -61,15 +68,15 @@ jobs:

services:
mysql:
image: mysql:8.1.0
image: mysql:8.1
env:
MYSQL_ROOT_PASSWORD: ${{ secrets.DB_ROOT_PASSWORD }}
MYSQL_DATABASE: test
MYSQL_USER: user
MYSQL_PASSWORD: ${{ secrets.DB_PASSWORD }}
ports:
- "3306:3306"

runs-on: ubuntu-22.04
steps:
- name: Checkout code
Expand All @@ -83,9 +90,18 @@ jobs:
working-directory: ./Backend
run: cp env .env

- name: Wait for MySQL
run: |
wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh
chmod +x wait-for-it.sh
./wait-for-it.sh 127.0.0.1:3306 --timeout=60
- name: Migration
working-directory: ./Backend
run: go run ./cmd/migrate/migrate.go
run: |
go run ./cmd/migrate/migrate.go
go run ./cmd/migrate/game_card_seeder.go
- name: 🎯 Acceptance test
working-directory: ./Backend
run: go test ./... -v -count=1 -coverprofile=coverage.out
Expand All @@ -94,4 +110,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: acceptance-test-coverage-report
path: ./Backend/coverage.out
path: ./Backend/coverage.out
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Backend

Backend/cmd/app/docs/swagger.*
Backend/.env
/.idea/*
vendor/
Loading

0 comments on commit ef87a39

Please sign in to comment.