This repository has been archived by the owner on Oct 28, 2023. It is now read-only.
PTCS Update 3 #18
Workflow file for this run
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
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@v3 | |
- 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 }} |