mirror of
https://github.com/finegrain-ai/refiners.git
synced 2024-11-27 16:38:46 +00:00
58 lines
1.4 KiB
YAML
58 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: ["**"]
|
|
pull_request_target:
|
|
types: [labeled]
|
|
|
|
jobs:
|
|
lint_and_typecheck:
|
|
if: ${{ github.event_name == 'push' || github.event.label.name == 'run-ci' }}
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: check changes
|
|
uses: dorny/paths-filter@v3
|
|
id: changes
|
|
with:
|
|
filters: |
|
|
sources:
|
|
- src/**
|
|
- tests/**
|
|
- scripts/**
|
|
|
|
- name: Install Rye
|
|
if: steps.changes.outputs.sources == 'true'
|
|
uses: eifinger/setup-rye@v2
|
|
with:
|
|
enable-cache: true
|
|
cache-prefix: "refiners-rye-cache"
|
|
|
|
- name: add Rye shims dir to PATH
|
|
if: steps.changes.outputs.sources == 'true'
|
|
run: echo "$RYE_HOME/shims" >> $GITHUB_PATH
|
|
|
|
- name: pin python
|
|
if: steps.changes.outputs.sources == 'true'
|
|
run: rye pin 3.10
|
|
|
|
- name: rye sync
|
|
if: steps.changes.outputs.sources == 'true'
|
|
run: rye sync --all-features
|
|
|
|
- name: rye fmt
|
|
if: steps.changes.outputs.sources == 'true'
|
|
run: rye fmt --check
|
|
|
|
- name: rye lint
|
|
if: steps.changes.outputs.sources == 'true'
|
|
run: rye lint
|
|
|
|
- name: typecheck
|
|
if: steps.changes.outputs.sources == 'true'
|
|
run: rye run pyright
|