Skip to content

Commit c5921b6

Browse files
committed
Split GitHub Actions into separate workflows for testing and code quality checks
1 parent cf52ef0 commit c5921b6

File tree

3 files changed

+63
-12
lines changed

3 files changed

+63
-12
lines changed
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Code Quality and Kedro Run Check
1+
name: Code Quality Checks
22

33
on:
44
push:
@@ -13,26 +13,23 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v3
16-
1716
- name: Set up Python
1817
uses: actions/setup-python@v4
1918
with:
2019
python-version: '3.8'
21-
2220
- name: Install Python tools (Black with Jupyter, Bandit, Ruff)
2321
run: pip install "black[jupyter]" bandit ruff
24-
2522
- name: Auto-fix Formatting Issues with Black
2623
run: black .
27-
2824
- name: Auto-fix Linting Errors with Ruff
2925
run: ruff --fix .
30-
3126
- name: Security Check with Bandit
3227
run: bandit -r .
33-
34-
- name: Install Kedro project dependencies
35-
run: pip install -r docker-requirements.txt
36-
37-
- name: Run Kedro Pipeline
38-
run: kedro run
28+
# Commit and push changes made by Black and Ruff
29+
- name: Commit and push if changed
30+
run: |
31+
git config --global user.name 'github-actions'
32+
git config --global user.email '[email protected]'
33+
git add -A
34+
git commit -m "Automated code quality fixes" -a || echo "No changes to commit"
35+
git push

.github/workflows/test_code.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Test Code with Docker
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test-code:
13+
runs-on: ubuntu-latest
14+
services:
15+
docker:
16+
image: docker:19.03.12
17+
options: --privileged
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.8'
24+
- name: Install Kedro and Docker plugin
25+
run: pip install -r dev-requirements.txt
26+
- name: Configure Docker
27+
run: sudo service docker start
28+
- name: Build docker image (using Kedro-Docker)
29+
run: kedro docker build
30+
- name: Run the docker container (using Kedro-Docker)
31+
run: kedro docker run
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Test Code Without Docker
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test-code:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.8'
20+
- name: Install Kedro project dependencies
21+
run: pip install -r docker-requirements.txt
22+
- name: Run Kedro Pipeline
23+
run: kedro run

0 commit comments

Comments
 (0)