Skip to content

Commit

Permalink
Merge pull request #12 from shun198/release/1.0.0
Browse files Browse the repository at this point in the history
Release/1.0.0
  • Loading branch information
shun198 authored Jan 24, 2023
2 parents 00ae14d + 601a783 commit 1ab675f
Show file tree
Hide file tree
Showing 13 changed files with 315 additions and 328 deletions.
Empty file added .github/labeler.yml
Empty file.
23 changes: 0 additions & 23 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,3 @@ version-resolver:
template: |
## Changes
$CHANGES
autolabeler:
- label: enhancement
branch:
- '/^feat(ure)?[/-].+/'
- label: bug
branch:
- '/^fix[/-].+/'
- label: emergency
branch:
- '/^hotfix[/-].+/'
- label: test
branch:
- '/^test[/-].+/'
- label: refactor
branch:
- '/(refactor|refactoring)[/-].+/'
- label: documentation
branch:
- '/doc(umentation)[/-].+/'
- label: test
branch:
- '/test[/-].+/'
14 changes: 14 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
45 changes: 45 additions & 0 deletions .github/workflows/test-service-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test Service Container
on:
pull_request:
branches-ignore:
- "release/**"
jobs:
test:
name: Run Test Code
runs-on: ubuntu-20.04
services:
mysql:
image: mysql:8.0.31
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: django-db
MYSQL_USER: django
MYSQL_PASSWORD: django
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'poetry'
- run: poetry install
- name: Show databases for root user
run: mysql --protocol=tcp -h localhost -P 3306 -u root -proot -e "select user,host FROM mysql.user"
- name: Give privileges to runner
run: |
GRANT ALL PRIVILEGES ON *.* TO 'runner'@'%';
FLUSH PRIVILEGES;
- name: Run migration
run: |
poetry run python manage.py makemigrations
poetry run python manage.py migrate
- name: Run tests
run: poetry run pytest
12 changes: 0 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,3 @@ repos:
hooks:
- id: isort
name: isort (python)
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args:
[
"-rn", # Only display messages
"-sn", # Don't display the score
]
Empty file.
9 changes: 9 additions & 0 deletions application/tests/models/test_user.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.db import DataError, IntegrityError
from django.test import TransactionTestCase

from application.models import User


class TestUser(TransactionTestCase):
fixtures = ["fixture.json"]
model = User
4 changes: 2 additions & 2 deletions containers/mysql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ FROM mysql:8.0

# MySQLのローカルの設定ファイルをコンテナにコピー
COPY containers/mysql/my.cnf /etc/mysql/conf.d/my.cnf
# init.sq;をコンテナの/docker-entrypoint-init.db.dと共有
COPY containers/mysql/init.sql /docker-entrypoint-initdb.d
# init.sqlをコンテナの/docker-entrypoint-init.db.dと共有
COPY containers/mysql/init.sql /docker-entrypoint-initdb.d
2 changes: 1 addition & 1 deletion containers/mysql/init.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-- MYSQL_USERに権限を付与
GRANT ALL PRIVILEGES ON *.* TO 'django'@'%';
FLUSH PRIVILEGES;
FLUSH PRIVILEGES;
Loading

0 comments on commit 1ab675f

Please sign in to comment.