Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI for Python #190

Merged
merged 4 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/ci.python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Python CI

on:
push:
branches:
- main
pull_request:
branches:
- main

defaults:
run:
shell: bash
working-directory: ./python

jobs:
pyright:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
python-version:
- '3.11'
- '3.12'

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Hatch
run: |
python -m pip install --upgrade pip
pip install hatch

- name: Set up Hatch Environment
run: |
hatch env create
HATCH_ENV=$(hatch env find)
echo $HATCH_ENV
echo "$HATCH_ENV/bin" >> $GITHUB_PATH

- name: Get Pyright Version
id: pyright-version
run: |
PYRIGHT_VERSION=$(jq -r '.devDependencies.pyright' < package.json)
echo $PYRIGHT_VERSION
echo "version=$PYRIGHT_VERSION" >> $GITHUB_OUTPUT

- name: Run pyright ${{ steps.pyright-version.outputs.version }}
uses: jakebailey/pyright-action@v2
with:
version: ${{ steps.pyright-version.outputs.version }}
no-comments: ${{ matrix.python-version != '3.12' || matrix.os != 'ubuntu-latest' }} # Only let one build post comments.
working-directory: ./python
2 changes: 1 addition & 1 deletion python/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"author": "Microsoft",
"license": "MIT",
"devDependencies": {
"pyright": "^1.1.341"
"pyright": "1.1.341"
}
}
Loading