Skip to content

Commit

Permalink
ci: pass if relavant files have not been changed (#98)
Browse files Browse the repository at this point in the history
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
  • Loading branch information
ktro2828 authored Feb 11, 2025
1 parent 2899da1 commit fb51535
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,17 @@ on:
workflow_dispatch:

jobs:
need-ci:
build-and-test:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
changes: ${{ steps.changes.outputs.changes }}
continue-on-error: true
strategy:
matrix:
python-version: ["3.10", "3.12"]

steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Filter paths
- name: Check if relevant files have been changed
uses: dorny/paths-filter@v3
id: changes
id: is-changed
with:
filters: |
changes:
Expand All @@ -30,34 +27,28 @@ jobs:
- t4_devkit/**
- tests/**
build-and-test:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
python-version: ["3.10", "3.12"]
needs:
- need-ci
if: (!failure()) && (needs.need-ci.outputs.changes == 'true')

steps:
- name: Checkout code
if: ${{ steps.is-changed.outputs.changes == 'true'}}
uses: actions/checkout@v4

- name: Define a cache dependency glob
if: ${{ steps.is-changed.outputs.changes == 'true'}}
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"

- name: Install the project
if: ${{ steps.is-changed.outputs.changes == 'true'}}
run: uv sync

- name: Run tests
if: ${{ steps.is-changed.outputs.changes == 'true'}}
run: uv run pytest --cov-report xml:coverage.xml --cov=t4_devkit

- name: Get test coverage
if: ${{ steps.is-changed.outputs.changes == 'true'}}
uses: orgoro/coverage@v3.1
continue-on-error: true
with:
Expand Down

0 comments on commit fb51535

Please sign in to comment.