Skip to content

Commit

Permalink
Merge pull request #113 from cateiru/v2
Browse files Browse the repository at this point in the history
V2
  • Loading branch information
cateiru authored Jul 6, 2024
2 parents f28940e + 75e40e3 commit b05674f
Show file tree
Hide file tree
Showing 941 changed files with 169,467 additions and 37,822 deletions.
42 changes: 42 additions & 0 deletions .air.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
root = "."
testdata_dir = "testdata"
tmp_dir = "tmp"

[build]
args_bin = []
bin = "/air_tmp"
cmd = "go build -o /air_tmp -buildvcs=false ."
delay = 0
exclude_dir = []
exclude_file = []
exclude_regex = ["_test.go"]
exclude_unchanged = false
follow_symlink = false
full_bin = ""
include_dir = ["src", "templates"]
include_ext = ["go", "tpl", "tmpl", "html"]
include_file = []
kill_delay = "0s"
log = "build-errors.log"
rerun = false
rerun_delay = 500
send_interrupt = false
stop_on_error = false

[color]
app = ""
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"

[log]
main_only = false
time = false

[misc]
clean_on_exit = false

[screen]
clear_on_rebuild = false
keep_scroll = true
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.github/
.git

# storybook
.storybook/
storybook-static/
stories/

# other
scripts/

.storage/
db/
.next/
.swc/
.data/
17 changes: 17 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
build/
next.config.js
.data/
.github/
.next/
.storage/
.swc/
src/
db/
scripts/
public/
storybook-static/

!stories/**/*.stories.tsx

# app以下は.well-knownなどデフォルトでignoreされてしまう場合があるので、明示的にignoreしないようにする
!app/**/*.tsx
34 changes: 34 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"extends": [
"./node_modules/gts/",
"next",
"plugin:import/errors",
"plugin:storybook/recommended"
],
"plugins": [
"prefer-arrow",
"import"
],
"rules": {
"prefer-arrow/prefer-arrow-functions": [
"error",
{
"disallowPrototype": true,
"singleReturnOnly": true,
"classPropertiesAllowed": false
}
],
"sort-imports": 0,
"import/order": [
2,
{
"alphabetize": {
"order": "asc"
}
}
],
"react-hooks/exhaustive-deps": "off",
"node/no-unpublished-import": "off",
"node/no-unsupported-features/node-builtins": "off"
}
}
46 changes: 0 additions & 46 deletions .github/workflows/pkg_test.yml

This file was deleted.

94 changes: 60 additions & 34 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,76 @@

name: Lint
name: ci

on:
push:
branches: [ main ]
paths:
- 'api/**'
- 'front/**'
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
nextjs:
name: next test
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v1
- name: yarn install
working-directory: ./front
run: yarn install --dev
- name: Run gts
working-directory: ./front
run: yarn lint
- name: Build
working-directory: ./front
run: yarn build
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18.17.0

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: pnpm install
run: pnpm i --frozen-lockfile
- name: run gts
run: pnpm lint
- name: build
run: pnpm build
env:
NEXT_PUBLIC_SERVER_API_HOST: 'https://api.staging.oreore.me'
go:
name: go test
runs-on: ubuntu-latest
timeout-minutes: 5
env:
TZ: 'Asia/Tokyo'
STORAGE_URL: 'localhost:4443'
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Build
working-directory: ./api
run: go build -v ./...

- name: Test
working-directory: ./api
run: |
docker-compose up -d
go test ./... -v -coverpkg=./... -race -coverprofile=coverage.out -covermode=atomic
- name: Upload coverage to Codecov
working-directory: ./api
run: bash <(curl -s https://codecov.io/bash)
- uses: actions/checkout@v4
- name: setup go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: start database
run: ./scripts/docker-compose-db.sh up -d
- name: go module download
run: go mod download
- name: install tparse
run: go install github.com/mfridman/tparse@latest
- name: build
run: go build -v ./...
- name: test
run: ./scripts/test.sh -cover -json | tee ./go-test.out | tparse
- name: add job summary
if: always()
run: |
tparse -all -file ./go-test.out -format markdown >> $GITHUB_STEP_SUMMARY
- name: upload coverage to codecov
uses: codecov/codecov-action@v3
Loading

0 comments on commit b05674f

Please sign in to comment.