Skip to content

Commit

Permalink
workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
pinzon committed Oct 16, 2024
1 parent 51ac4fa commit 9a32171
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish to PyPI

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest

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

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
pip install -e .[test]
- name: Run tests
run: pytest

- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build project
run: python -m build

- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Run Tests

on:
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

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

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install dependencies
run: |
pip install -e .[test]
- name: Run tests
run: pytest
6 changes: 5 additions & 1 deletion tests/test_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@
("{ $.bandwidth = 80 || $.refreshRate >= 60}", True),
("{ $.bandwidth != 80 || $.refreshRate >= 60}", True),
("{ $.bandwidth != 80 || $.refreshRate != 60}", False),
# # Grouped
# Grouped
("{ ($.bandwidth = 80) || ($.refreshRate >= 60)}", True),
("{ ($.bandwidth = 80 || $.refreshRate >= 60)}", True),
("{ $.bandwidth = 80 && ($.refreshRate >= 60)}", True),
# Non existent attributes
("{ $.non-existent = 80 }", False),
('{ $["non-existent"] = 80 }', False),
('{ $["number"][4]= 80 }', False),
]


Expand Down

0 comments on commit 9a32171

Please sign in to comment.