Skip to content

Commit

Permalink
Merge pull request #660 from isucon/ci/go
Browse files Browse the repository at this point in the history
CIでgo実装にPrepareを実行するように
  • Loading branch information
FujishigeTemma authored Sep 10, 2021
2 parents b553375 + 2179710 commit 45eecc5
Show file tree
Hide file tree
Showing 10 changed files with 121 additions and 876 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/ci-frontend.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/ci-webapp.yaml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Frontend

on:
push:
branches:
- 'main'
pull_request:
paths:
- 'webapp/frontend/**'

defaults:
run:
working-directory: ./webapp/frontend

jobs:
packages:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- name: setup Node
uses: actions/setup-node@v2
with:
node-version: 14
check-latest: true
cache: npm
cache-dependency-path: ./webapp/frontend/package-lock.json
- name: install dependencies
run: npm ci
lint:
runs-on: self-hosted
needs: [packages]
steps:
- uses: actions/checkout@v2
- name: setup Node
uses: actions/setup-node@v2
with:
node-version: 14
check-latest: true
cache: npm
cache-dependency-path: ./webapp/frontend/package-lock.json
- name: install dependencies
run: npm ci
- name: run lint
run: npm run lint
build:
runs-on: self-hosted
needs: [packages]
steps:
- uses: actions/checkout@v2
- name: setup Node
uses: actions/setup-node@v2
with:
node-version: 14
check-latest: true
cache: npm
cache-dependency-path: ./webapp/frontend/package-lock.json
- name: install dependencies
run: npm ci
- name: run build
run: npm run build
57 changes: 57 additions & 0 deletions .github/workflows/golang.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Go

on:
push:
branches:
- 'main'
paths:
- benchmarker/**
- webapp/golang/**
- webapp/frontend/** # bench/assets.go の更新検知のために回す
- dev/frontend/Dockerfile
- dev/golang/Dockerfile
- dev/nginx/default.conf
- dev/Makefile
- dev/compose.yaml
- .github/workflows/golang.yml
pull_request:
paths:
- benchmarker/**
- webapp/golang/**
- webapp/frontend/** # bench/assets.go の更新検知のために回す
- dev/frontend/Dockerfile
- dev/golang/Dockerfile
- dev/nginx/default.conf
- dev/Makefile
- dev/compose.yaml
- .github/workflows/golang.yml

jobs:
lint:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
working-directory: ./webapp/golang
args: "-c ../../.github/.golangci.yaml"
test:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- name: setup environments
run: make up
working-directory: ./dev
- uses: actions/setup-go@v2
with:
go-version: 1.16
- name: run -no-load
run: |
make
./bin/benchmarker -no-load
working-directory: ./benchmarker
- name: teardown environments
run: make down
working-directory: ./dev
File renamed without changes.
7 changes: 2 additions & 5 deletions dev/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
TBLS_VERSION := 1.50.0

.PHONY: up
up: ## prepare dev environment
@docker compose up -d --build
@until (curl -X POST --silent http://localhost:7000/initialize) do sleep 1;done; echo initialized
@docker-compose up -d --build

.PHONY: down
down: ## destroy dev environment
@docker compose down -v
@docker-compose down -v

.PHONY: help
help: ## Show help
Expand Down
3 changes: 0 additions & 3 deletions dev/docker-compose.yml → dev/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ services:
- "8080:80"
depends_on:
- backend

backend:
build:
context: ../webapp/golang
Expand All @@ -28,7 +27,6 @@ services:
- mysql
volumes:
- ../webapp:/webapp

mysql:
image: mysql
restart: always
Expand All @@ -45,7 +43,6 @@ services:
- "3306:3306"
volumes:
- mysql:/var/lib/mysql

adminer:
image: adminer:latest
restart: always
Expand Down
Loading

0 comments on commit 45eecc5

Please sign in to comment.