Skip to content

Commit

Permalink
Split tests in production workflow to avoid Ouf Of Memory (137) (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
mart-r authored Jun 19, 2024
1 parent ffd22a6 commit f6f3654
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
python -m unittest discover
all_files=$(git ls-files | grep '^tests/.*\.py$' | grep -v '/__init__\.py$' | sed 's/\.py$//' | sed 's/\//./g')
num_files=$(echo "$all_files" | wc -l)
midpoint=$((num_files / 2))
first_half_nl=$(echo "$all_files" | head -n $midpoint)
second_half_nl=$(echo "$all_files" | tail -n +$(($midpoint + 1)))
timeout 25m python -m unittest ${first_half_nl[@]}
timeout 25m python -m unittest ${second_half_nl[@]}
- name: Install pypa/build
run: >-
Expand Down

0 comments on commit f6f3654

Please sign in to comment.