Skip to content

Commit

Permalink
adds ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
christophkloeffel committed Apr 10, 2024
1 parent 666f8af commit 1d51fc3
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 17 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: LOBSTER CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

permissions:
contents: read

jobs:
lint:
name: PyLint
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pylint pycodestyle
python3 -m pip install -r requirements.txt
make lobster/html/assets.py
- name: Style check
run: |
make style
- name: Lint
run: |
make lint -o style
test:
name: Test
strategy:
matrix:
py-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.py-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Executing system tests
run: |
make system-tests
- name: Executing unit tests
run: |
make unit-tests
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,37 +40,37 @@ packages:
diff -Naur test_install/lib/python*/site-packages/lobster test_install_monolithic/lib/python*/site-packages/lobster -x "*.pyc"
diff -Naur test_install/bin test_install_monolithic/bin

integration_tests: packages
integration-tests: packages
(cd integration-tests/projects/basic; make)
(cd integration-tests/projects/filter; make)

system_tests:
system-tests:
make -B -C test-system/lobster-json
make -B -C test-system/lobster-python

unit_tests:
unit-tests:
python3 -m unittest discover -s test-unit -v

test: integration_tests system_tests unit_tests
test: integration-tests system-tests unit-tests

upload_main: packages
upload-main: packages
python3 -m twine upload --repository pypi packages/*/dist/*
python3 -m twine upload --repository pypi packages/*/meta_dist/*

remove_dev:
remove-dev:
python3 -m util.release

github_release:
github-release:
git push
python3 -m util.github_release

bump:
python3 -m util.bump_version_post_release

full_release:
make remove_dev
full-release:
make remove-dev
git push
make upload_main
make github_release
make upload-main
make github-release
make bump
git push
10 changes: 5 additions & 5 deletions lobster/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def lobster_read(mh, filename, level, items, source_info=None):

if source_info is not None:
item.perform_source_checks(source_info)

# evaluate source_info filters
for f, v in source_info['filters']:
if f == 'prefix':
Expand All @@ -125,9 +125,9 @@ def lobster_read(mh, filename, level, items, source_info=None):
if all(filter_conditions):
if item.tag.key() in items:
mh.error(item.location,
"duplicate definition of %s, "
"previously defined at %s" %
(item.tag.key(),
items[item.tag.key()].location.to_string()))
"duplicate definition of %s, "
"previously defined at %s" %
(item.tag.key(),
items[item.tag.key()].location.to_string()))

items[item.tag.key()] = item
1 change: 0 additions & 1 deletion lobster/tools/json/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# <https://www.gnu.org/licenses/>.

import sys
import os.path
import json
from pathlib import PurePath
from pprint import pprint
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
trlc>=1.2.2
requests>=2.31.0
libcst>=1.1.0

0 comments on commit 1d51fc3

Please sign in to comment.