Skip to content

Commit 0857e1c

Browse files
committed
update github actions
1 parent 632c9d0 commit 0857e1c

File tree

3 files changed

+41
-17
lines changed

3 files changed

+41
-17
lines changed

.github/workflows/lint.yaml

+13-15
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
name: Lint
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
4+
workflow_call
85

96
jobs:
107
lint:
8+
name: Runs pre-commit
119
runs-on: ubuntu-latest
12-
13-
env:
14-
PYTHON_VERSION: "3.9.12"
15-
1610
steps:
17-
- name: Checks out repository
18-
uses: actions/checkout@v3
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
1913

20-
- name: Set up Python ${{ env.PYTHON_VERSION }}
21-
uses: actions/setup-python@v3
14+
- name: Install Python Dependencies
15+
uses: HassanAbouelela/actions/setup-python@setup-python_v1.5.0
2216
with:
23-
python-version: ${{ env.PYTHON_VERSION }}
17+
python_version: "3.11"
18+
install_args: "--with=dev"
19+
20+
- name: Run pre-commit hooks
21+
run: SKIP=ruff-lint pre-commit run --all-files
2422

25-
- name: Run black
26-
uses: psf/black@stable
23+
- name: Run ruff
24+
run: "ruff check --output-format=github ."

.github/workflows/test.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Run Unit Test via Pytest
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.11"]
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python ${{ matrix.python-version }}
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install poetry
22+
poetry install
23+
- name: Test with pytest
24+
run: |
25+
coverage run -m pytest -v -s
26+
- name: Generate Coverage Report
27+
run: |
28+
coverage report -m

.pre-commit-config.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ repos:
55
- id: check-toml
66
- id: check-yaml
77
- id: end-of-file-fixer
8-
- id: trailing-whitespace
9-
args: [ --markdown-linebreak-ext=md ]
108

119
- repo: https://github.com/astral-sh/ruff-pre-commit
1210
rev: v0.4.4

0 commit comments

Comments
 (0)