-
Notifications
You must be signed in to change notification settings - Fork 68
54 lines (45 loc) · 1.5 KB
/
formatting.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
50
51
52
53
54
name: formatting
on:
push:
branches:
- release/v**
- main
jobs:
formatting:
name: Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout repository
with:
ssh-key: ${{secrets.DEPLOY_KEY}}
- name: Configure Git
run: |
git config --local user.email "action@github.com"
git config --local user.name "Github Action"
git config --local core.autocrlf true
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}
- name: Install REL and dependencies
run: |
pip install -U pip
pip install -e .[develop]
- name: Code formatting
run: |
isort .
black .
- name: Commit formatting changes
run: |
git add -u
git commit -m "[skip ci] Code formatting" -a || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: ${{ github.ref }}
ssh-key: ${{secrets.DEPLOY_KEY}}