Skip to content

Commit 19375cb

Browse files
committed
Split requirement files, merge CI actions
1 parent 2e85f91 commit 19375cb

File tree

5 files changed

+38
-44
lines changed

5 files changed

+38
-44
lines changed
Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Package with Pyinstaller
1+
name: CI
22

33
on:
44
push:
@@ -51,8 +51,39 @@ jobs:
5151
README.md
5252
if-no-files-found: error
5353

54+
build-test:
55+
runs-on: ubuntu-latest
56+
strategy:
57+
matrix:
58+
python-version: [ 3.11 ]
59+
steps:
60+
- uses: actions/checkout@v3
61+
- name: Set up Python ${{ matrix.python-version }}
62+
uses: actions/setup-python@v3
63+
with:
64+
python-version: ${{ matrix.python-version }}
65+
- name: Install dependencies
66+
run: |
67+
python -m pip install --upgrade pip
68+
pip install build twine
69+
pip install -r requirements.txt
70+
pip install -r test-requirements.txt
71+
sudo apt-get install xvfb
72+
- name: Lint with flake8
73+
run: |
74+
flake8 --count --show-source --statistics --max-line-length=120 \
75+
--per-file-ignores=src/nexus/Freqlog/backends/__init__.py:F401 --exclude=venv
76+
- name: Build package
77+
run: python -m build
78+
- name: Check and install package
79+
run: |
80+
twine check dist/*
81+
pip install .
82+
- name: Test with pytest over Xvfb
83+
run: xvfb-run -a pytest --cov=nexus
84+
5485
release:
55-
needs: [ package, docs ]
86+
needs: [ package, docs, build-test ]
5687
runs-on: ubuntu-latest
5788
if: |
5889
github.repository_owner == 'CharaChorder' &&

.github/workflows/build-test.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

dist.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
print("Installing requirements...")
3737
os.system("python -m pip install --upgrade pip")
3838
os.system("python -m pip install -r requirements.txt")
39+
os.system("python -m pip install -r test-requirements.txt")
3940

4041
# Pyinstaller command
4142
cmd = "pyinstaller -Fn nexus src/nexus/__main__.py"

requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
pynput~=1.7.6
22
pyinstaller~=5.10.1
33
setuptools~=67.6.1
4-
5-
pytest~=7.3.1

test-requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
flake8~=6.0.0
2+
pytest~=7.3.1
3+
pytest-cov~=4.0.0
4+
pre-commit~=3.2.2

0 commit comments

Comments
 (0)