Skip to content

Commit 0a4f720

Browse files
committed
ci(workflow): add pre-commit workflow and update python versions
1 parent 56c0d1a commit 0a4f720

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

.github/workflows/pre-commit.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Pre-commit
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
run:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: True
10+
matrix:
11+
os: [ ubuntu-latest ]
12+
env:
13+
OS: ${{ matrix.os }}
14+
PYTHON: '3.10'
15+
steps:
16+
- uses: actions/checkout@master
17+
- name: Setup Python
18+
uses: actions/setup-python@master
19+
with:
20+
python-version: '3.10'
21+
- name: Update setuptools
22+
run: |
23+
pip install -U setuptools wheel
24+
- name: Install
25+
run: |
26+
pip install -q -e .[dev]
27+
- name: Install pre-commit
28+
run: |
29+
pre-commit install
30+
- name: Pre-commit starts
31+
run: |
32+
pre-commit run --all-files > pre-commit.log 2>&1 || true
33+
cat pre-commit.log
34+
if grep -q Failed pre-commit.log; then
35+
echo -e "\e[41m [**FAIL**] Please install pre-commit and format your code first. \e[0m"
36+
exit 1
37+
fi
38+
echo -e "\e[46m ********************************Passed******************************** \e[0m"

.github/workflows/python-publish.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3-
4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
8-
91
name: Publish Python Package to Pypi
102

113
on:

.github/workflows/unittest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
os: [ubuntu-latest, windows-latest, macos-15]
12-
python-version: ['3.10', '3.11', '3.12']
12+
python-version: ['3.10']
1313
env:
1414
OS: ${{ matrix.os }}
1515
steps:

0 commit comments

Comments
 (0)