-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (85 loc) · 3.44 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: CI
on:
push:
pull_request:
types: [opened, reopened]
defaults:
run:
shell: bash
jobs:
CI:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 1
matrix:
os: [ubuntu-20.04, macos-10.15]
qt-version: [ '6.1.2' ]
python-version: [ '3.8' ]
steps:
- uses: actions/checkout@v2
- name: Cache Qt
id: cache-qt
uses: actions/cache@v2
with:
path: ${{ runner.workspace }}/Qt
key: ${{ runner.os }}-Qt${{ matrix.qt-version }}-cache
- name: Install Qt
uses: jurplel/install-qt-action@v2.11.1
with:
version: ${{ matrix.qt-version }}
cached: ${{ steps.cache-qt.outputs.cache-hit }}
aqtversion: ==1.2.4 # <1.2.0 has problem with osx installation of Qt 6
- name: Cache Python dependencies
if: ${{ runner.os == 'Linux' }}
uses: actions/cache@v2
with:
path: /home/runner/.cache/pypoetry/
key: ${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Cache Python dependencies
if: ${{ runner.os == 'macOS' }}
uses: actions/cache@v2
with:
path: /Users/runner/Library/Caches/pypoetry/
key: ${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
if [ "${{ matrix.os }}" == "ubuntu-20.04" ]; then
sudo apt-get install llvm
fi
python${{ matrix.python-version }} -m pip install --upgrade pip
git clone --depth 1 --single-branch --branch 1.2.0a2 https://github.com/python-poetry/poetry.git
pushd poetry
python${{ matrix.python-version }} install-poetry.py --version 1.2.0a2
popd
rm -r poetry
echo "$HOME/.local/bin" >> $GITHUB_PATH
if [ "${{ runner.os }}" == "macOS" ]; then
# is needed for macos to make poetry available
export PATH="/Users/runner/.local/bin:$PATH"
# qt on macos is installed in framework mode, includes like 'QtCore/QUrl' cannot be resolved by default
ln -sf $Qt6_DIR/lib/QtCore.framework/Versions/A/Headers/* $Qt6_DIR/lib/QtCore.framework/Versions/A/Headers/${{ matrix.qt-version }}/QtCore/
ln -sf $Qt6_DIR/lib/QtGui.framework/Versions/A/Headers/* $Qt6_DIR/lib/QtGui.framework/Versions/A/Headers/${{ matrix.qt-version }}/QtGui/
ln -sf $Qt6_DIR/lib/QtNetwork.framework/Versions/A/Headers/* $Qt6_DIR/lib/QtNetwork.framework/Versions/A/Headers/${{ matrix.qt-version }}/QtNetwork/
fi
poetry env use ${{ matrix.python-version }}
poetry install --verbose
poetry run pip3 install PySide6 # temporary workaround, poetry can't install PySide6. TODO: investigate
# git clone https://github.com/quotient-im/libQuotient.git PyQuotient/libQuotient
git clone https://github.com/Aksem/libQuotient.git -b qt-6.1 PyQuotient/libQuotient
- name: Build
run: |
poetry env use ${{ matrix.python-version }}
mkdir -p build
pushd build
cmake -DBUILD_TESTING=OFF -DBUILD_WITH_QT6=ON -DQT_PATH=$Qt6_DIR -DPYTHON_ENV_VERSION=${{ matrix.python-version }} ../
make
popd
- name: Run unit tests
run: |
poetry env use ${{ matrix.python-version }}
poetry run python3 -m pytest