forked from OSGeo/grass-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (39 loc) · 1.07 KB
/
black.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
name: Python Black Formatting
on:
push:
branches:
- grass[0-9]+
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress:
# Do not cancel on protected branches, like grass8
${{ github.ref_protected != true }}
permissions: {}
jobs:
run-black:
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-22.04
python-version: "3.10"
black-version: 22.3.0
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: |
python -m pip install --upgrade pip
pip install black==${{ matrix.black-version }}
- name: Run Black
run: |
black --check --diff .