-
Notifications
You must be signed in to change notification settings - Fork 2
174 lines (128 loc) · 5.33 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
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
name: Main
on: [push, pull_request]
jobs:
test-install-and-run-from-git:
name: Test - Install & Run from Github
runs-on: ubuntu-latest
steps:
- name: Create Dummy Package.json
run: echo \{\} > package.json
- name: Install Current Version as Git Dependency
run: npm install ${{ github.repository }}#${{ github.sha }}
- name: 'Debug: List Dependency Folder Contents'
run: find node_modules/deluge-rpc-socket -type f -print
- name: Ensure Built files are there
working-directory: node_modules/deluge-rpc-socket
# TODO: make this a better test
run: ls package.json dist/{DelugeRPC.{js,d.ts},utils/SharedPromise.js}
check-format:
name: Check - Format
runs-on: ubuntu-latest
steps:
- name: Checkout latest code
uses: actions/checkout@v1
- name: Build
run: yarn install
- name: Prettier
run: yarn format --check
check-spelling:
name: Check - Spelling
runs-on: ubuntu-latest
steps:
- name: Checkout latest code
uses: actions/checkout@v1
- name: Build
run: yarn install
- name: Spelling
run: yarn spellcheck
test-with-coverage:
name: Generate - Coverage Reports
runs-on: ubuntu-latest
steps:
- name: Checkout latest code
uses: actions/checkout@v1
# - name: Set up Python
# uses: actions/setup-python@v1
# with:
# python-version: 2.7
- name: 'Debug: Node version'
run: node --version
- name: Apt Update
run: sudo apt-get update
- name: Install Needed tools
run: sudo apt-get install colordiff deluged virtualenv git intltool closure-compiler python3-libtorrent python3-geoip python3-dbus python3-gi python3-gi-cairo gir1.2-gtk-3.0 gir1.2-appindicator3 python-pygame libnotify4 librsvg2-common xdg-utils -y
- name: Remove deluged global
run: sudo apt-get remove deluged
# Deluge 1.3
- name: Setup Virtual Env for Deluge 1.3 with Python 2
run: virtualenv --system-site-packages --python=/usr/bin/python2 deluge-1.3-env
- name: Install Deluge 1.3
run: deluge-1.3-env/bin/pip2 install git+git://deluge-torrent.org/[email protected]
- name: "Debug: List Deluge v1.3's files, post install"
working-directory: deluge-1.3-env
run: find * \( -path node_modules -o -path .git -o -name __pycache__ -o -path \*/site-packages/\* \) -print -prune -o -type f -print | tee /tmp/build.list
- name: Start Deluge 1.3 Daemon
run: deluge-1.3-env/bin/deluged --port=8999 --config=deluge1 --loglevel debug --logfile deluge1.log
# Deluge 2.x
- name: Setup Virtual Env for Deluge 2 with Python 3
run: virtualenv --system-site-packages --python=/usr/bin/python3 deluge-2-env
- name: Install Deluge 2
run: deluge-2-env/bin/pip install git+git://deluge-torrent.org/deluge.git@master
- name: "Debug: List Deluge 2's files, post install"
working-directory: deluge-2-env
run: find * \( -path node_modules -o -path .git -o -name __pycache__ -o -path \*/site-packages/\* \) -print -prune -o -type f -print | tee /tmp/build.list
- name: Start Deluge 2 Daemon
run: deluge-2-env/bin/deluged --port=9001 --config=deluge2 --loglevel debug --logfile deluge2.log
# JavaScript Dependencies
- name: Build
run: yarn install --color
- name: 'Debug: List post build files'
run: find * \( -path node_modules -o -path .git -o -name __pycache__ -o -path \*/site-packages/\* \) -print -prune -o -type f -print | tee /tmp/build.list
# Check Deluged Status
- name: Listening ports
run: sudo netstat --listening --program --numeric --tcp
- name: Deluged 1 Logs
run: egrep --color=always '|DEBUG' deluge1.log
- name: Deluged 2 Logs
run: egrep --color=always '|DEBUG' deluge2.log
# Run Tests
- name: Test with Coverage
run: yarn test --ci --coverage --colors
env:
DELUGE1_PORT: 8999
DELUGE2_PORT: 9001
# DELUGE1_HOST: localhost
# DELUGE2_HOST: localhost
- name: 'Debug: List post Coverage files'
run: find * \( -path node_modules -o -path .git -o -name __pycache__ -o -path \*/site-packages/\* \) -print -prune -o -type f -print | tee /tmp/coverage.list
- name: 'Debug: Coverage diff'
run: 'colordiff -U 0 /tmp/build.list /tmp/coverage.list || :'
- name: Coveralls GitHub Action
if: always()
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Shutdown Deluged 1
run: echo TODO
- name: Shutdown Deluged 2
run: echo TODO
publish:
name: Publish - Master
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs:
[
test-with-coverage,
test-install-and-run-from-git,
check-spelling,
check-format,
]
steps:
- name: Checkout latest code
uses: actions/checkout@v1
- name: Create .npmrc with Auth Token
run: echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
- name: Publish to npm
run: 'npm publish || :'
env:
NPM_TOKEN: ${{ secrets.npm_token }}