Skip to content

Commit

Permalink
Run full test diff for the latest CI Python version only
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Aug 18, 2023
1 parent 5928e1c commit 5c380f0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
python:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- 'latest' # hardcoded below as '3.11'
- 'beta' # hardcoded below as '3.12'
fail-fast: false

permissions:
Expand All @@ -23,7 +29,8 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
python-version: ${{ matrix.python == 'latest' && '3.11' || (matrix.python == 'beta' && '3.12' || matrix.python) }}
allow-prereleases: true

- name: Install tools
run: |
Expand All @@ -50,19 +57,20 @@ jobs:
sed -i -r 's~.*/(test/)~\1~;t;d' log.txt
- name: Apply Coding Style
if: matrix.python == '3.11'
if: matrix.python == 'latest'
run: |
pip install black
python -m black .
- name: Diff Unit Tests Output and Coding Style
if: matrix.python == 'latest'
run: |
cd test
rm -r _build
git add . -N && git diff --exit-code
- name: Push Unit Tests Output
if: failure() && github.repository_owner != 'markstory' && matrix.python == '3.11'
if: failure() && github.repository_owner != 'markstory' && matrix.python == 'latest'
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: ${{ github.head_ref || github.ref_name }}.changes
Expand Down

0 comments on commit 5c380f0

Please sign in to comment.