Skip to content

Commit

Permalink
build: Only run Python tests when PR contains more than .po's
Browse files Browse the repository at this point in the history
  • Loading branch information
sarina authored and brian-smith-tcril committed Nov 9, 2023
1 parent 97fa161 commit f0a35a9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,37 @@ jobs:
runs-on: ubuntu-latest

steps:
# Define which file extensions, when touched, should trigger the
# Python tests, so we can skip this Action if we've only touched .po files
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
non_pofiles:
- '**.txt'
- '**.yml'
- '**.in'
- '**.py'
# Clones the openedx-translations repo
- name: clone openedx/openedx-translations
uses: actions/checkout@v3

- name: Install gettext
if: steps.filter.outputs.non_pofiles == 'true'
run: |
sudo apt install -y gettext
# Sets up Python
- name: setup python
if: steps.filter.outputs.non_pofiles == 'true'
uses: actions/setup-python@v4
with:
python-version: '3.8'

# Run the script
- name: run python tests
if: steps.filter.outputs.non_pofiles == 'true'
run: |
make test_requirements
make test

0 comments on commit f0a35a9

Please sign in to comment.