Skip to content

Commit

Permalink
Add CI for Python (#190)
Browse files Browse the repository at this point in the history
* Add CI for Python

* Some more logging and info

* Rename job

* Need working dir, darn
  • Loading branch information
jakebailey authored Feb 23, 2024
1 parent 6fe009f commit 63551fd
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
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"
}
}

0 comments on commit 63551fd

Please sign in to comment.