-
-
Notifications
You must be signed in to change notification settings - Fork 19
82 lines (79 loc) · 2.69 KB
/
main.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
name: Smoke Build And Test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
smoke-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: '3.8.x' # Semantic version range syntax or exact version of a Python version
architecture: 'x64'
- name: Cache pip
uses: actions/cache@v1
with:
path: ~/.cache/pip # This path is specific to Ubuntu
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install swig
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
(New-Object System.Net.WebClient).DownloadFile("http://prdownloads.sourceforge.net/swig/swigwin-4.0.1.zip","swigwin-4.0.1.zip");
Expand-Archive .\swigwin-4.0.1.zip .;
echo "::add-path::./swigwin-4.0.1"
- name: Check swig
run: swig -version
- name: Install python and deps
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller==4.8
- name: Build Project
run: |
cd ./lifx_control_panel
set PYTHONOPTIMIZE=1 && pyinstaller --onefile --noupx build_all.spec
cd ..
test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: '3.8.x' # Semantic version range syntax or exact version of a Python version
architecture: 'x64'
- name: Cache pip
uses: actions/cache@v1
with:
path: ~/.cache/pip # This path is specific to Ubuntu
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Test Project
run: |
pip3 install --user -r requirements.txt
pip3 install --user -r requirements-dev.txt
cd ./lifx_control_panel
set PYTHONPATH=.
coverage run -m unittest discover test -p "*test*.py"
coverage report
coverage xml -o coverage.xml
cd ..
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ./lifx_control_panel/coverage.xml
flags: unittests