Skip to content

Commit 3e06e43

Browse files
committed
Update CI/CD workflows and add badges to README
- Update python-app.yml: use Python 3.12, scanrequirements.txt, run pytest - Update pylint.yml: use Python 3.10-3.12 matrix, setup-python@v5 - Add CI, Lint, and Tests badges to README.md
1 parent 7805a38 commit 3e06e43

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

.github/workflows/pylint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pylint
1+
name: Lint
22

33
on: [push]
44

@@ -7,11 +7,11 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: ["3.8", "3.9", "3.10"]
10+
python-version: ["3.10", "3.11", "3.12"]
1111
steps:
1212
- uses: actions/checkout@v4
1313
- name: Set up Python ${{ matrix.python-version }}
14-
uses: actions/setup-python@v3
14+
uses: actions/setup-python@v5
1515
with:
1616
python-version: ${{ matrix.python-version }}
1717
- name: Install dependencies

.github/workflows/python-app.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a single version of Python
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
33

4-
name: Python application
4+
name: CI
55

66
on:
77
push:
@@ -19,21 +19,19 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v4
22-
- name: Set up Python 3.10
23-
uses: actions/setup-python@v3
22+
- name: Set up Python 3.12
23+
uses: actions/setup-python@v5
2424
with:
25-
python-version: "3.10"
25+
python-version: "3.12"
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
2929
pip install flake8 pytest
30-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
30+
if [ -f scanrequirements.txt ]; then pip install -r scanrequirements.txt; fi
3131
- name: Lint with flake8
3232
run: |
33-
# stop the build if there are Python syntax errors or undefined names
3433
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3634
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3735
- name: Test with pytest
3836
run: |
39-
pytest
37+
pytest tests/python/unit/ -v

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
![Socrates Blade Mascot](assets/socrates-blade-min.png)
66
![Version](https://img.shields.io/badge/version-3.2.0-blue)
77
![License](https://img.shields.io/badge/license-MIT-green)
8+
[![CI](https://github.com/MalangPHPUG/socrates-blade/actions/workflows/python-app.yml/badge.svg)](https://github.com/MalangPHPUG/socrates-blade/actions/workflows/python-app.yml)
9+
[![Lint](https://github.com/MalangPHPUG/socrates-blade/actions/workflows/pylint.yml/badge.svg)](https://github.com/MalangPHPUG/socrates-blade/actions/workflows/pylint.yml)
10+
[![Tests](https://github.com/MalangPHPUG/socrates-blade/actions/workflows/python-app.yml/badge.svg?label=tests)](https://github.com/MalangPHPUG/socrates-blade/actions/workflows/python-app.yml)
811

912
---
1013

0 commit comments

Comments
 (0)