Skip to content

Commit

Permalink
ci: group checks by Python version, sort by most recent
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoliwa committed Mar 27, 2023
1 parent 7d670ee commit 9945bd5
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python.yaml
Expand Up @@ -13,10 +13,10 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.10", "3.9", "3.8", "3.7"]
# ubuntu-latest is being moved from ubuntu-18.04 to ubuntu-20.04
# See https://github.com/actions/virtual-environments/issues/1816
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
env:
PYTHONUNBUFFERED: 1
Expand Down
4 changes: 2 additions & 2 deletions docs/ideas/yaml/contains.toml
Expand Up @@ -3,7 +3,7 @@
[[".github/workflows/python.yaml".contains]]
__jmespath = "jobs.build.strategy.matrix"
os = ["ubuntu-latest", "macos-latest", "windows-latest"]
"python-version" = ["3.7", "3.8", "3.9", "3.10", "3.11"]
"python-version" = ["3.11", "3.10", "3.9", "3.8", "3.7"]

# 3. Same as item 4 on "jmespath-on-section.toml", but with a different syntax.
[[".github/workflows/python.yaml".contains]]
Expand Down Expand Up @@ -56,7 +56,7 @@ __yaml = "- uses: actions/checkout@v2"
[[".github/workflows/python.yaml".contains_sorted]]
__jmespath = "jobs.build.strategy.matrix"
os = ["ubuntu-latest", "macos-latest", "windows-latest"]
"python-version" = ["3.7", "3.8", "3.9", "3.10", "3.11"]
"python-version" = ["3.11", "3.10", "3.9", "3.8", "3.7"]

[[".github/workflows/python.yaml".contains_sorted]]
__jmespath = "jobs.build"
Expand Down
2 changes: 1 addition & 1 deletion docs/ideas/yaml/merge_lists/merged_style.toml
@@ -1,4 +1,4 @@
# This should be the result of a parent style including all the styles in this directory
[".github/workflows/python.yaml".jobs.build.strategy.matrix]
os = ["ubuntu-latest", "macos-latest", "windows-latest"]
"python-version" = ["3.7", "3.8", "3.9", "3.10", "3.11"]
"python-version" = ["3.11", "3.10", "3.9", "3.8", "3.7"]
2 changes: 1 addition & 1 deletion src/nitpick/resources/python/github-workflow.toml
Expand Up @@ -11,7 +11,7 @@ fail-fast = false

[".github/workflows/python.yaml".jobs.build.strategy.matrix]
os = ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version = ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version = ["3.11", "3.10", "3.9", "3.8", "3.7"]

[".github/workflows/python.yaml".jobs.build]
name = "${{ matrix.python-version }} ${{ matrix.os }}"
Expand Down
Expand Up @@ -11,11 +11,11 @@ jobs:
- windows-latest
- macos-latest
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.10'
- '3.9'
- '3.8'
- '3.7'
name: ${{ matrix.python-version }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_yaml/new-desired.toml
Expand Up @@ -12,7 +12,7 @@ with = {"python-version" = "${{ matrix.python-version }}"}

[".github/workflows/python.yaml".jobs.build.strategy.matrix]
os = ["ubuntu-latest", "macos-latest", "windows-latest"]
"python-version" = ["3.7", "3.8", "3.9", "3.10", "3.11"]
"python-version" = ["3.11", "3.10", "3.9", "3.8", "3.7"]

[".github/workflows/python.yaml".jobs.build]
"runs-on" = "${{ matrix.os }}"
8 changes: 4 additions & 4 deletions tests/test_yaml/new-expected.yaml
Expand Up @@ -13,9 +13,9 @@ jobs:
- macos-latest
- windows-latest
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.10'
- '3.9'
- '3.8'
- '3.7'
runs-on: ${{ matrix.os }}

0 comments on commit 9945bd5

Please sign in to comment.