-
Notifications
You must be signed in to change notification settings - Fork 56
50 lines (45 loc) · 1.34 KB
/
check_code_quality.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
name: check_code_quality
on:
push:
branches: [ main ]
paths:
- "src/**.py"
- "test/**.py"
- "template/**.py"
pull_request:
branches: [ main ]
paths:
- "src/**.py"
- "test/**.py"
- "template/**.py"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
build:
name: Check Code Quality
runs-on: ubuntu-latest
if: github.repository == 'aws/sagemaker-distribution'
permissions:
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./environment.yml
environment-name: sagemaker-distribution
init-shell: bash
- name: Free up disk space
run: rm -rf /opt/hostedtoolcache
- name: Activate sagemaker-distribution
run: micromamba activate sagemaker-distribution
- name: Check style with black
run: black --line-length=120 --check src test template
- name: Check style with autoflake
run: autoflake --in-place --expand-star-imports --ignore-init-module-imports --remove-all-unused-imports -rc src test template
- name: Check style with isort
run: isort --profile black -c src test template