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 59d184c
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 9 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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: 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
22 changes: 13 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@ dependencies = []
requires-python = ">=3.9"
readme = "README.md"
license = {text = "MIT"}
src_paths = ["olxquery", "tests"]


[build-system]
requires = ["pdm-pep517>=1.0"]
build-backend = "pdm.pep517.api"

[tool.ruff]
lint.select = ["F", "E", "W"]
line-length = 100

[tool.isort]
profile = "black"
[tool.pdm]
src_paths = ["olxquery", "tests"]

[tool.pdm.dev-dependencies]
test = [
Expand All @@ -35,5 +29,15 @@ release = [
"python-semantic-release>=9.11.0",
]

[tool.ruff]
lint.select = ["F", "E", "W"]
line-length = 100

[tool.isort]
profile = "black"

[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 59d184c

Please sign in to comment.