|
@@ -1,13 +1,28 @@
|
|
|
name: Python Black Formatting
|
|
|
|
|
|
on:
|
|
|
- - push
|
|
|
- - pull_request
|
|
|
+ push:
|
|
|
+ branches:
|
|
|
+ - main
|
|
|
+ - releasebranch_*
|
|
|
+ tags:
|
|
|
+ - "*.*.*"
|
|
|
+ pull_request:
|
|
|
|
|
|
jobs:
|
|
|
run-black:
|
|
|
- name: Check
|
|
|
- runs-on: ubuntu-20.04
|
|
|
+ name: Black ${{ matrix.black-version }}
|
|
|
+
|
|
|
+ # Using matrix just to get variables which are not environmental variables
|
|
|
+ # and also to sync with other workflows which use matrix.
|
|
|
+ strategy:
|
|
|
+ matrix:
|
|
|
+ include:
|
|
|
+ - os: ubuntu-20.04
|
|
|
+ python-version: "3.10"
|
|
|
+ black-version: "22.1.0"
|
|
|
+
|
|
|
+ runs-on: ${{ matrix.os }}
|
|
|
|
|
|
steps:
|
|
|
- uses: actions/checkout@v2
|
|
@@ -15,12 +30,12 @@ jobs:
|
|
|
- name: Set up Python
|
|
|
uses: actions/setup-python@v2
|
|
|
with:
|
|
|
- python-version: 3.8
|
|
|
+ python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
- name: Install
|
|
|
run: |
|
|
|
python -m pip install --upgrade pip
|
|
|
- pip install black==21.5b1
|
|
|
+ pip install black==${{ matrix.black-version }}
|
|
|
|
|
|
- name: Run Black
|
|
|
run: |
|