fix github actions triggers

This commit is contained in:
Hugues Pouillot 2024-02-06 15:35:36 +01:00 committed by Hugues Pouillot
parent 907a6becbc
commit 1fa5266f56

View file

@ -2,11 +2,7 @@ name: CI
on: on:
push: push:
paths: branches: ["**"]
- src/**
- tests/**
- scripts/**
- .github/workflows/ci.yml
pull_request_target: pull_request_target:
types: [labeled] types: [labeled]
@ -19,26 +15,43 @@ jobs:
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: check changes
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
sources:
- src/**
- tests/**
- scripts/**
- name: Install Rye - name: Install Rye
if: steps.changes.outputs.sources == 'true'
uses: eifinger/setup-rye@v1 uses: eifinger/setup-rye@v1
with: with:
enable-cache: true enable-cache: true
cache-prefix: 'refiners-rye-cache' cache-prefix: "refiners-rye-cache"
- name: add home shims dir to PATH - name: add home shims dir to PATH
if: steps.changes.outputs.sources == 'true'
run: echo "$HOME/.rye/shims" >> $GITHUB_PATH run: echo "$HOME/.rye/shims" >> $GITHUB_PATH
- name: pin python - name: pin python
if: steps.changes.outputs.sources == 'true'
run: rye pin 3.10 run: rye pin 3.10
- name: rye sync - name: rye sync
if: steps.changes.outputs.sources == 'true'
run: rye sync --all-features run: rye sync --all-features
- name: ruff format - name: ruff format
if: steps.changes.outputs.sources == 'true'
run: rye run ruff format --check . run: rye run ruff format --check .
- name: ruff check - name: ruff check
if: steps.changes.outputs.sources == 'true'
run: rye run ruff check . run: rye run ruff check .
- name: typecheck - name: typecheck
if: steps.changes.outputs.sources == 'true'
run: rye run pyright run: rye run pyright