2023-08-04 13:28:41 +00:00
|
|
|
name: CI
|
2023-12-08 11:26:50 +00:00
|
|
|
|
2023-12-14 16:50:22 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request_target:
|
|
|
|
types: [labeled]
|
2023-08-04 13:28:41 +00:00
|
|
|
|
2023-12-08 11:26:50 +00:00
|
|
|
jobs:
|
2023-08-04 13:28:41 +00:00
|
|
|
lint_and_typecheck:
|
2023-12-14 16:50:22 +00:00
|
|
|
if: ${{ github.event.name == 'push' || github.event.label.name == 'run-ci' }}
|
2023-08-04 13:28:41 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-12-08 11:26:50 +00:00
|
|
|
|
2023-08-04 13:28:41 +00:00
|
|
|
steps:
|
|
|
|
- name: checkout
|
2023-09-04 13:41:31 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-08-04 13:28:41 +00:00
|
|
|
|
2023-12-08 11:26:50 +00:00
|
|
|
- name: Install Rye
|
|
|
|
uses: eifinger/setup-rye@v1
|
2023-08-04 13:28:41 +00:00
|
|
|
with:
|
2023-12-08 11:26:50 +00:00
|
|
|
enable-cache: true
|
|
|
|
cache-prefix: 'refiners-rye-cache'
|
2023-08-04 13:28:41 +00:00
|
|
|
|
2023-12-08 11:26:50 +00:00
|
|
|
- name: add home shims dir to PATH
|
|
|
|
run: echo "$HOME/.rye/shims" >> $GITHUB_PATH
|
|
|
|
|
|
|
|
- name: pin python
|
|
|
|
run: rye pin 3.10
|
2023-08-04 13:28:41 +00:00
|
|
|
|
2023-12-08 11:26:50 +00:00
|
|
|
- name: rye sync
|
|
|
|
run: rye sync --all-features
|
2023-08-04 13:28:41 +00:00
|
|
|
|
2023-12-08 11:26:50 +00:00
|
|
|
- name: ruff format
|
|
|
|
run: rye run ruff format --check .
|
2023-08-29 15:53:39 +00:00
|
|
|
|
2023-12-08 11:26:50 +00:00
|
|
|
- name: ruff check
|
|
|
|
run: rye run ruff check .
|
2023-08-04 13:28:41 +00:00
|
|
|
|
|
|
|
- name: typecheck
|
2023-12-08 11:26:50 +00:00
|
|
|
run: rye run pyright
|