-
-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (43 loc) · 1.44 KB
/
Copy pathdev-ci.yml
File metadata and controls
50 lines (43 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Development Continuous Integration
permissions:
contents: write
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
dev:
name: Format, lint & test project
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
env:
PAYSTACK_SECRET_KEY: ${{ secrets.PAYSTACK_SECRET_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies with uv
run: uv sync --all-groups
- name: Format with ruff
run: uv run ruff format .
- name: Lint with ruff
run: uv run ruff check . --fix
- name: Test package
run: |
uv run python -m unittest discover tests/unit
- name: Commit changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Apply auto-formatting" || echo "No changes to commit"
- name: Push changes
run: |
git push