Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

gogatsusai2024 に向けた PTCS の更新 #12

gogatsusai2024 に向けた PTCS の更新

gogatsusai2024 に向けた PTCS の更新 #12

Workflow file for this run

name: Lint and format ptcs
on:
pull_request:
paths:
- '.github/workflows/ptcs-ci.yml'
- 'ptcs/ptcs_bridge/**'
- 'ptcs/ptcs_control/**'
- 'ptcs/ptcs_server/**'
- 'ptcs/.flake8'
- 'ptcs/poetry.lock'
- 'ptcs/poetry.toml'
- 'ptcs/pyproject.toml'
workflow_dispatch:
jobs:
ci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: 'ptcs'
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Poetry
run: |
export POETRY_HOME=/opt/poetry
python -m venv $POETRY_HOME
$POETRY_HOME/bin/pip install poetry==1.6.1
$POETRY_HOME/bin/poetry --version
echo "$POETRY_HOME/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
poetry install
- name: Sort imports
run: |
poetry run isort ptcs_bridge ptcs_control ptcs_server 2>&1 | reviewdog -reporter=github-pr-review -f=isort
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Format
run: |
poetry run black ptcs_bridge ptcs_control ptcs_server 2>&1 | reviewdog -reporter=github-pr-review -f=black
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add and commit
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
- name: Lint
run: |
poetry run flake8 ptcs_bridge ptcs_control ptcs_server 2>&1 | reviewdog -reporter=github-pr-review -f=flake8
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Typecheck
run: |
poetry run mypy ptcs_bridge ptcs_control ptcs_server 2>&1 | reviewdog -reporter=github-pr-review -f=mypy
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}