-
Notifications
You must be signed in to change notification settings - Fork 79
35 lines (28 loc) · 967 Bytes
/
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
name: Lint
on: [push, pull_request]
jobs:
black:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v4
- name: Extract black version from setup.py
run: |
echo "BLACK_VERSION=$(python -c 'from setup import black_version; print(black_version)')" >> $GITHUB_ENV
# ensure conformity with https://github.com/mlcommons/GaNDLF/blob/master/setup.py#L77
- uses: psf/[email protected]
with:
version: ${{ env.BLACK_VERSION }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip==24.0
python -m pip install black==${{ env.BLACK_VERSION }}
- name: Run tests
run: |
python -m black --check .