-
Notifications
You must be signed in to change notification settings - Fork 2
184 lines (182 loc) · 7.21 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: build
on:
push:
paths-ignore:
- 'README.md'
pull_request:
paths-ignore:
- 'README.md'
schedule:
- cron: '0 6 * * *'
jobs:
test-python:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ['2.7', '3.11']
steps:
- uses: actions/checkout@v4
- name: Set up Python 3
if: matrix.python-version != '2.7'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade Python 3 pip
if: matrix.python-version != '2.7'
run: |
python -m pip install --upgrade pip
- name: Set up Python 2
if: matrix.python-version == '2.7'
run: |
sudo apt-get update
sudo apt install -y python2
sudo ln -sf /usr/bin/python2 /usr/bin/python
curl -L -O "https://bootstrap.pypa.io/pip/2.7/get-pip.py"
python get-pip.py
- name: Install dependencies
run: |
pip install flake8
- name: Compile sources
run: |
python -O -m compileall ./usr/lib/enigma2/python/Components/
- name: Check code with flake8
run: |
flake8 --ignore=E501,W191 --builtins="_" --show-source
test-skin:
needs: test-python
runs-on: ubuntu-20.04
env:
CC: "gcc-10"
CXX: "g++-10"
steps:
- uses: actions/checkout@v4
- name: Set enigma2 repository
uses: actions/checkout@v4
with:
repository: 'OpenPLi/enigma2'
ref: 'develop'
path: './enigma2'
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install twisted pyopenssl service_identity netifaces
- name: Install dev packages
run: |
sudo apt-get -q update
sudo apt install docbook-xsl gettext libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libfribidi-dev libavahi-client-dev libgif-dev mm-common
- name: Set tuxtxt repository
uses: actions/checkout@v4
with:
repository: 'OpenPLi/tuxtxt'
path: './tuxtxt'
- name: Build enigma dependencies
run: |
git clone --depth 1 https://github.com/jack2015/libdvbsi.git
cd libdvbsi
autoreconf -i
./configure
make
sudo make install
cd ../tuxtxt/libtuxtxt
autoreconf -i
./configure --with-boxtype=generic DVB_API_VERSION=5
make
sudo make install
cd ../tuxtxt
autoreconf -i
./configure --with-boxtype=generic DVB_API_VERSION=5
make
sudo make install
cd ../..
git clone --depth 1 https://github.com/dbus-cxx/libsigc--3.0.git
cd libsigc--3.0
autoreconf -i
./configure
make
sudo make install
- name: Patch enigma cpp files
run: |
sed -i 's/eFatal/eDebug/g' enigma2/lib/gdi/gfbdc.cpp
sed -i 's/${sysconfdir}\/enigma2/.\/data/g' enigma2/lib/dvb/db.cpp
sed -i 's/bsodCatchSignals/\/\/bsodCatchSignals/g' enigma2/main/enigma.cpp
sed -i 's/${libdir}\/enigma2\/python\/StartEnigma.py/..\/test\/check_skin.py/g' enigma2/main/enigma.cpp
- name: Build enigma
run: |
cd ./enigma2
autoreconf -i
./configure --with-libsdl=no --with-boxtype=nobox --enable-dependency-tracking ac_cv_prog_c_openmp=-fopenmp --with-textlcd
make
cd ./data
python convert-iso-639-3.py
- name: Patch enigma py files
run: |
sed -i 's/DEFAULT_SKIN = Sys/DEFAULT_SKIN = "SimpleGray-HD\/skin.xml" # Sys/g' enigma2/lib/python/skin.py
sed -i 's/reloadWindowStyles() #/# reloadWindowStyles() #/g' enigma2/lib/python/skin.py
sed -i 's/setResolution(xres, yres/setResolution(xres, yres, 8/g' enigma2/lib/python/skin.py
sed -i 's/${datadir}\/enigma2\/po\//.\/po\//g' enigma2/lib/python/Tools/Directories.py
sed -i 's/${datadir}\/enigma2\//.\/data\//g' enigma2/lib/python/Tools/Directories.py
sed -i 's/${datadir}\//.\/data\//g' enigma2/lib/python/Tools/Directories.py
sed -i 's/${sysconfdir}\/enigma2\//\/tmp\//g' enigma2/lib/python/Tools/Directories.py
sed -i 's/${sysconfdir}\//\/tmp\//g' enigma2/lib/python/Tools/Directories.py
sed -i 's/${libdir}\/enigma2\//.\/lib\//g' enigma2/lib/python/Tools/Directories.py
sed -i 's/${libdir}\//.\//g' enigma2/lib/python/Tools/Directories.py
sed -i 's/\/media\//\/tmp\/media\//g' enigma2/lib/python/Tools/Directories.py
sed -i 's/${datadir}\/enigma2/.\/data/g' enigma2/lib/python/Tools/ISO639.py
- name: Setup skin files for test
run: |
cp -R usr/lib/enigma2/* enigma2/lib
cp -R usr/share/enigma2/SimpleGray-HD enigma2/data
cp usr/share/fonts/* enigma2/data/fonts
- name: ========== Test skin screens load ==========
working-directory: './enigma2'
run: |
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib PYTHONPATH=../test:./lib/python ENIGMA_DEBUG_LVL=0 main/enigma2
deploy:
needs: test-python
if: always() && !contains(github.event.head_commit.message,'skip-release') && github.event_name == 'push' && needs.test-python.result == 'success' && github.repository == 'Taapat/skin-SimpleGray' && github.ref == 'refs/heads/master'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 2.7
run: |
sudo apt-get update
sudo apt install -y python2
sudo ln -sf /usr/bin/python2 /usr/bin/python
- name: Compile sources
run: |
python -O -m compileall ./usr/lib/enigma2/python/Components/
- name: Set git variables
run: |
echo "SRCPV=git$(git rev-list --count HEAD)" >> $GITHUB_ENV
echo "PKGV=git$(git rev-list --count HEAD)-1-${GITHUB_SHA::7}-r0.0" >> $GITHUB_ENV
echo "COMMIT_SUBJECT=$(git log -1 --pretty=format:%s)" >> $GITHUB_ENV
- name: Create plugin package files
run: |
sed -i 's/Version:/Version: ${{ env.PKGV }}/' deploy/control/control
mkdir ipk
- name: Build data package
run: |
tar --numeric-owner --group=0 --owner=0 -czf ./deploy/data.tar.gz ./usr/*
- name: Build control package
working-directory: './deploy/control'
run: |
tar --numeric-owner --group=0 --owner=0 -czf ../control.tar.gz ./*
- name: Build ipk package
working-directory: './deploy'
run: |
echo 2.0 > debian-binary
ar rv ../ipk/enigma2-plugin-skins-simple-gray_${{ env.PKGV }}_all.ipk debian-binary data.tar.gz control.tar.gz
ar rv ../ipk/enigma2-plugin-skins-simple-gray_${{ env.PKGV }}_all.ipk debian-binary data.tar.gz control.tar.gz
- name: Create release
uses: Taapat/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.SRCPV }}
name: ${{ env.COMMIT_SUBJECT }}
gzip: false
files: ipk/enigma2-plugin-skins-simple-gray_${{ env.PKGV }}_all.ipk