Skip to content

Commit

Permalink
build: add ci with github actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
felipepaes committed Oct 25, 2024
1 parent bab0a26 commit 0c2af1a
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Lint commit messages
uses: wagoid/commitlint-github-action@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install PDM
run: |
pip install --user pdm
pdm self update
- name: Install dependencies
run: pdm install

- name: Cache PDM packages
uses: actions/cache@v4
with:
path: ~/.cache/pdm
key: ${{ runner.os }}-pdm-${{ hashFiles('pdm.lock') }}
restore-keys: ${{ runner.os }}-pdm-

- name: Lint code
run: pdm run lint

- name: Run tests
run: pdm run test
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ release = [
]

[tool.pdm.scripts]
test = "pytest -vvv"
test = "pytest -vvv"
ruff = "ruff check"
isort = "isort olxquery tests --check-only --diff"
lint = {composite = ["ruff", "isort"]}

0 comments on commit 0c2af1a

Please sign in to comment.