Skip to content

Commit 6ae4b28

Browse files
committed
ci: added CI config (partially copied from aw-watcher-afk)
1 parent 3f88423 commit 6ae4b28

File tree

6 files changed

+157
-41
lines changed

6 files changed

+157
-41
lines changed

.github/workflows/build.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
name: Test on ${{ matrix.os }} (py-${{ matrix.python_version }})
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-18.04] # Uncommented until pynput migration done: windows-latest, macOS-latest
17+
python_version: [3.7, 3.9]
18+
steps:
19+
- uses: actions/checkout@v2
20+
with:
21+
submodules: 'recursive'
22+
- name: Set up Python
23+
uses: actions/setup-python@v1
24+
with:
25+
python-version: ${{ matrix.python_version }}
26+
- name: Create virtualenv
27+
shell: bash
28+
run: |
29+
python -m venv venv
30+
- name: Install dependencies
31+
shell: bash
32+
run: |
33+
pip install poetry
34+
source venv/bin/activate || source venv/Scripts/activate
35+
poetry install
36+
- name: Run tests
37+
shell: bash
38+
run: |
39+
source venv/bin/activate || source venv/Scripts/activate
40+
make test
41+
- name: Package
42+
shell: bash
43+
run: |
44+
source venv/bin/activate || source venv/Scripts/activate
45+
pip install pyinstaller==4.3
46+
make package
47+
- name: Test package
48+
shell: bash
49+
run: |
50+
dist/aw-watcher-input/aw-watcher-input --help
51+
- name: Upload package
52+
uses: actions/upload-artifact@v2
53+
with:
54+
name: aw-watcher-afk-${{ runner.os }}-py${{ matrix.python_version }}
55+
path: dist/aw-watcher-afk

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
__pycache__
2+
build
3+
dist

Makefile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.PHONY: build test package clean
2+
3+
build:
4+
poetry install
5+
6+
test:
7+
poetry run aw-watcher-input --help # Ensures that it at least starts
8+
make typecheck
9+
10+
typecheck:
11+
poetry run mypy src/aw_watcher_input --ignore-missing-imports
12+
13+
package:
14+
pyinstaller aw-watcher-input.spec --clean --noconfirm
15+
16+
clean:
17+
rm -rf build dist
18+
rm -rf aw_watcher_input/__pycache__

aw-watcher-input.spec

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# -*- mode: python -*-
2+
3+
block_cipher = None
4+
5+
name = "aw-watcher-input"
6+
7+
8+
a = Analysis(['src/aw_watcher_input/__main__.py'],
9+
pathex=[],
10+
binaries=None,
11+
datas=None,
12+
hiddenimports=[
13+
'Xlib.keysymdef.miscellany',
14+
'Xlib.keysymdef.latin1',
15+
'Xlib.keysymdef.latin2',
16+
'Xlib.keysymdef.latin3',
17+
'Xlib.keysymdef.latin4',
18+
'Xlib.keysymdef.greek',
19+
'Xlib.support.unix_connect',
20+
'Xlib.ext.shape',
21+
'Xlib.ext.xinerama',
22+
'Xlib.ext.composite',
23+
'Xlib.ext.randr',
24+
'Xlib.ext.xfixes',
25+
'Xlib.ext.security',
26+
'Xlib.ext.xinput',
27+
],
28+
hookspath=[],
29+
runtime_hooks=[],
30+
excludes=[],
31+
win_no_prefer_redirects=False,
32+
win_private_assemblies=False,
33+
cipher=block_cipher)
34+
pyz = PYZ(a.pure, a.zipped_data,
35+
cipher=block_cipher)
36+
exe = EXE(pyz,
37+
a.scripts,
38+
exclude_binaries=True,
39+
name=name,
40+
debug=False,
41+
strip=False,
42+
upx=True,
43+
console=True )
44+
coll = COLLECT(exe,
45+
a.binaries,
46+
a.zipfiles,
47+
a.datas,
48+
strip=False,
49+
upx=True,
50+
name=name)

poetry.lock

+32-40
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ aw-watcher-input = "aw_watcher_input.main:main"
1515
python = "^3.7"
1616
aw-client = {git = "https://github.com/ActivityWatch/aw-client.git"}
1717
aw-watcher-afk = {git = "https://github.com/ActivityWatch/aw-watcher-afk.git"}
18-
pyuserinput = {git = "https://github.com/PyUserInput/PyUserInput.git", rev = "ac2d4c7a7f4b1a72e70b1a2ef8925d5312fb12bc"}
1918

2019
[tool.poetry.dev-dependencies]
2120
mypy = "*"

0 commit comments

Comments
 (0)