Test workflow #23
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: Typecheck | |
on: | |
push: | |
branches: [eugene/test-workflow] | |
pull_request: {} | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: pipx install poetry | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
cache: 'poetry' | |
- run: poetry install | |
- run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH | |
- uses: jakebailey/pyright-action@v2 | |
with: | |
version: 1.1.311 | |
extra-args: src/backend/services/flow_test/metrics_flow_test1.py, src/backend/services/metrics_flow_test1.py | |
- name: Get new files added in the PR | |
id: get_new_files | |
run: | | |
git fetch origin main | |
echo 'new_py_files<<EOF' >> $GITHUB_OUTPUT | |
git diff --name-only --diff-filter=A origin/main HEAD | grep '\.py$' | |
echo 'EOF' >> $GITHUB_OUTPUT | |
- name: Typecheck new files | |
run: | | |
new_py_files="${{ steps.get_new_files.outputs.new_py_files }}" | |
echo "Checking new Python files with Pyright: $new_py_files" | |