-
Notifications
You must be signed in to change notification settings - Fork 595
89 lines (73 loc) · 2.59 KB
/
build.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
name: Build
on: [push, pull_request]
jobs:
test:
env:
TEST_ENV: travis
# FeelUOwn have Chinese characters in feeluown help message.
# It needs an encoding which can encode Chinese character
# while windows use cp1252 as the default encoding.
PYTHONIOENCODING: utf-8
runs-on: ${{ matrix.os }}
strategy:
# Allow some jobs fail.
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, macos-13]
python: ['3.8', '3.11']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Ubuntu dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get -y install libmpv1
- name: Install macOS Dependencies
if: startsWith(matrix.os, 'macos')
run: |
brew install mpv
- name: Setup DYLD path for macos-arm64
if: matrix.os == 'macos-latest'
run: |
# Python can't find libmpv on macOS arm64 by default.
# This problem does not exist on macOS with x86_64.
echo "DYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/lib" >> $GITHUB_ENV
echo "DYLD_FALLBACK_FRAMEWORK_PATH=/opt/homebrew/Frameworks" >> $GITHUB_ENV
- name: Install Windows Dependencies
if: startsWith(matrix.os, 'windows')
run: |
choco install make curl
curl -L https://github.com/feeluown/FeelUOwn/releases/download/v3.6a0/mpv-1.dll -o C:Windows\system32\mpv-1.dll
- name: Install Python Dependencies
run: |
pip install --upgrade pip
pip install pyqt5
pip install "pytest<7.2"
pip install -e .[dev,cookies,webserver,ytdl]
- name: Install Python(macOS) Dependencies
if: startsWith(matrix.os, 'macos')
run: |
pip install -e .[macos]
- name: Install Python(windows) Dependencies
if: startsWith(matrix.os, 'windows')
run: |
pip install -e .[win32]
- name: Test if no syntax error
run: feeluown -h
- name: Test
run: |
make test
- name: Integration Test
run: |
make integration_test
- name: Coveralls
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.8' && github.repository == 'feeluown/FeelUOwn'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install coveralls
coveralls --service=github