-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from nakkaa/release_v1.0.4
Release v1.0.4
- Loading branch information
Showing
28 changed files
with
305 additions
and
80 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 |
---|---|---|
|
@@ -107,14 +107,74 @@ jobs: | |
python -m pip install --upgrade pip | ||
pip install pipenv | ||
pipenv install --dev | ||
- name: Set .env | ||
run: | | ||
cp .env.example .env | ||
- name: Test | ||
run: | | ||
pipenv run python -m unittest | ||
# 型ヒントのチェックを行う | ||
pr-type-hint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: pipenv cache | ||
uses: actions/cache@v1 | ||
with: | ||
key: ${{ runner.os }}-${{ matrix.python-version }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} | ||
path: ~/.cache/pipenv | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.python-version }}-pipenv- | ||
- name: pip cache | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/Pipfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pipenv | ||
pipenv install --dev | ||
- name: Check type hints | ||
run: | | ||
pipenv run mypy . | ||
# 差分があるPythonファイルを取得する | ||
pr-check-python-files-with-diff: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
files: ${{steps.check-python-files-with-diff.outputs.files}} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Check Python file with diff | ||
id: check-python-files-with-diff | ||
run: | | ||
git fetch --no-tags --prune --depth=1 origin ${GITHUB_HEAD_REF} | ||
git fetch --no-tags --prune --depth=1 origin ${GITHUB_BASE_REF} | ||
echo "::set-output name=files::$(git diff origin/${GITHUB_BASE_REF}..origin/${GITHUB_HEAD_REF} --diff-filter=AM --name-only -- '*.py' | tr '\n' ' ')" | ||
# lintを行い、結果をPRにコメントとして表示する。 | ||
# ここではチェックは落ちない | ||
pr-lint: | ||
runs-on: ubuntu-latest | ||
needs: pr-check-python-files-with-diff | ||
# Pythonファイルが差分に含まれていない場合はスキップ | ||
if: needs.pr-check-python-files-with-diff.outputs.files != '' | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
|
@@ -151,9 +211,7 @@ jobs: | |
- name: Lint files | ||
id: lint | ||
run: | | ||
git fetch --no-tags --prune --depth=1 origin ${GITHUB_HEAD_REF} | ||
git fetch --no-tags --prune --depth=1 origin ${GITHUB_BASE_REF} | ||
result=$(pipenv run pylint --rcfile=./.pylintrc $(git diff origin/${GITHUB_BASE_REF}..origin/${GITHUB_HEAD_REF} --diff-filter=AM --name-only -- '*.py') 2>&1) || true | ||
result=$(pipenv run pylint --rcfile=./.pylintrc ${{needs.pr-check-python-files-with-diff.outputs.files}} 2>&1) || true | ||
result="${result//'%'/'%25'}" | ||
result="${result//$'\n'/'%0A'}" | ||
result="${result//$'\r'/'%0D'}" | ||
|
@@ -162,6 +220,7 @@ jobs: | |
continue-on-error: true | ||
# lint結果をコメントに残す | ||
- name: Lint Comment | ||
if: steps.lint.outputs.result != '' | ||
uses: actions/[email protected] | ||
with: | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
__pycache__/ | ||
.vscode/ | ||
setup/pgsql-data | ||
.mypy_cache/ |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.