Skip to content

Commit 3fe10e1

Browse files
authored
Add code quality check for release pipeline. (#22)
1 parent c3e2cf3 commit 3fe10e1

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

.github/workflows/pr-validation.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Pull Request Validation Pipeline
22
on: [pull_request]
33

44
jobs:
5-
pr-validation:
6-
name: Pull Request Validation
5+
code-quality-validation:
6+
name: Code Quality Validation
77
runs-on: ubuntu-22.04
88
steps:
99
- name: Generate GitHub App Token

.github/workflows/tag-and-release.yml

+49
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,58 @@ on:
66
- main
77

88
jobs:
9+
code-quality-validation:
10+
name: Code Quality Validation
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- name: Generate GitHub App Token
14+
id: generate_github_app_token
15+
uses: tibdex/[email protected]
16+
with:
17+
app_id: ${{ secrets.GH_APP_ID }}
18+
private_key: ${{ secrets.GH_APP_KEY }}
19+
20+
- name: Checkout repository
21+
uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
token: ${{ steps.generate_github_app_token.outputs.token }}
25+
persist-credentials: true
26+
27+
- name: Setup Python
28+
uses: actions/setup-python@v4
29+
with:
30+
python-version: 3.8
31+
32+
- name: Install & configure Poetry
33+
uses: snok/[email protected]
34+
with:
35+
version: 1.5.1
36+
37+
- name: Install & validate Poetry dependencies
38+
run: |
39+
poetry install
40+
poetry check
41+
42+
- name: Check pylint
43+
run: |
44+
set -e # fail on error
45+
poetry run pylint -j 0 --fail-under=10.0 src
46+
47+
- name: Check isort
48+
run: |
49+
set -e # fail on error
50+
poetry run isort --check-only .
51+
52+
- name: Check black
53+
run: |
54+
set -e # fail on error
55+
poetry run black --check .
56+
957
tag-release:
1058
name: Tag & Release
1159
runs-on: ubuntu-22.04
60+
needs: code-quality-validation
1261
steps:
1362
- name: Generate GitHub App Token
1463
id: generate_github_app_token

0 commit comments

Comments
 (0)