Skip to content

Commit 130715c

Browse files
Split Desktop into its own repo (#743)
Co-authored-by: Mia Moir <[email protected]>
1 parent d7b8f14 commit 130715c

File tree

115 files changed

+1542
-12538
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+1542
-12538
lines changed

.dockerignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
node_modules
1010

11-
desktop/out/
12-
desktop/.vite/
1311
server/.next/
1412
jobrunner/dist/
1513

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
env:
7676
PLAYWRIGHT_HTML_REPORT: ${{ github.workspace }}/server/playwright-report
7777

78-
- uses: actions/upload-artifact@v3
78+
- uses: actions/upload-artifact@v4
7979
if: failure()
8080
with:
8181
name: playwright-report-server

.github/workflows/tests.yml

Lines changed: 8 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
cache-dependency-path: "yarn.lock"
4040
- run: yarn install --immutable --inline-builds
4141

42-
- run: yarn prettier --check '{desktop,jobrunner,server}/**/*.{ts,tsx}'
42+
- run: yarn prettier --check '{jobrunner,server}/**/*.{ts,tsx}'
4343

4444
lint:
4545
runs-on: ubuntu-latest
@@ -87,7 +87,7 @@ jobs:
8787
uses: codecov/codecov-action@v4
8888
with:
8989
token: ${{ secrets.CODECOV_TOKEN }}
90-
files: ./desktop/coverage/coverage-final.json,./server/coverage/coverage-final.json,./jobrunner/coverage/coverage-final.json,./utility/testing/coverage/coverage-final.json
90+
files: ./server/coverage/coverage-final.json,./jobrunner/coverage/coverage-final.json,./utility/testing/coverage/coverage-final.json
9191

9292
test-integration-server-jobrunner:
9393
runs-on: ubuntu-latest
@@ -108,7 +108,7 @@ jobs:
108108
cache: "yarn"
109109
cache-dependency-path: "yarn.lock"
110110

111-
- uses: FedericoCarboni/setup-ffmpeg@v3
111+
- uses: afoley587/setup-ffmpeg@a7cd62787aaae92d7c452f79f85ab25e2b639bb0
112112
with:
113113
ffmpeg-version: "release"
114114

@@ -150,6 +150,10 @@ jobs:
150150
- name: Install dependencies
151151
run: yarn install --immutable --inline-builds
152152

153+
- uses: afoley587/setup-ffmpeg@a7cd62787aaae92d7c452f79f85ab25e2b639bb0
154+
with:
155+
ffmpeg-version: "release"
156+
153157
- name: Build server
154158
run: |
155159
yarn build
@@ -177,134 +181,9 @@ jobs:
177181
env:
178182
PLAYWRIGHT_HTML_REPORT: ${{ github.workspace }}/server/playwright-report
179183

180-
- uses: actions/upload-artifact@v3
184+
- uses: actions/upload-artifact@v4
181185
if: always()
182186
with:
183187
name: playwright-report-server
184188
path: ./server/playwright-report/
185189
retention-days: 30
186-
187-
test-e2e-desktop-standalone:
188-
timeout-minutes: 60
189-
runs-on: ubuntu-latest
190-
env:
191-
NODE_ENV: test
192-
E2E_TEST: "true"
193-
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
194-
steps:
195-
- uses: actions/checkout@v4
196-
- name: Use Node.js 18.x
197-
uses: actions/setup-node@v4
198-
with:
199-
node-version: 18.x
200-
cache: "yarn"
201-
cache-dependency-path: "yarn.lock"
202-
203-
- name: Install dependencies
204-
run: yarn install --immutable --inline-builds
205-
206-
- name: Build desktop
207-
run: yarn build
208-
working-directory: ./desktop
209-
210-
- name: Make logs folder
211-
run: mkdir -p ${{ runner.temp }}/logs
212-
213-
- name: Run Playwright tests
214-
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn ${{ runner.debug && 'test:e2e:debug' || 'test:e2e' }} --project standalone
215-
working-directory: ./desktop
216-
env:
217-
PLAYWRIGHT_HTML_REPORT: ${{ github.workspace }}/desktop/playwright-report
218-
BADGER_LOGS_PATH: ${{ runner.temp }}/logs
219-
220-
- uses: actions/upload-artifact@v3
221-
if: always()
222-
with:
223-
name: playwright-report-desktop
224-
path: |
225-
./desktop/playwright-report/
226-
./desktop/traces/
227-
./desktop/test-results/
228-
${{ runner.temp }}/logs
229-
retention-days: 30
230-
231-
test-e2e-desktop-complete:
232-
timeout-minutes: 60
233-
runs-on: ubuntu-latest
234-
env:
235-
NODE_ENV: test
236-
E2E_TEST: "true"
237-
DATABASE_URL: postgres://root:postgres@localhost:5432/badger_test
238-
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
239-
steps:
240-
- uses: actions/checkout@v4
241-
- name: Use Node.js 18.x
242-
uses: actions/setup-node@v4
243-
with:
244-
node-version: 18.x
245-
cache: "yarn"
246-
cache-dependency-path: "yarn.lock"
247-
248-
- name: Docker Compose
249-
uses: hoverkraft-tech/[email protected]
250-
251-
- name: Install dependencies
252-
run: yarn install --immutable --inline-builds
253-
254-
- uses: FedericoCarboni/setup-ffmpeg@v3
255-
with:
256-
ffmpeg-version: "release"
257-
258-
- name: Build server
259-
run: |
260-
yarn build
261-
cp -r public .next/standalone/server/public
262-
mkdir -p .next/standalone/server/.next
263-
cp -r .next/static .next/standalone/server/.next/static
264-
working-directory: ./server
265-
266-
- name: Build Jobrunner
267-
run: |
268-
yarn build
269-
cp ../utility/prisma/schema.prisma .
270-
working-directory: ./jobrunner
271-
272-
- name: Build desktop
273-
run: yarn build
274-
working-directory: ./desktop
275-
276-
- name: Migrate database
277-
run: yarn prisma:migrateProd
278-
279-
- name: Make logs folder
280-
run: mkdir -p ${{ runner.temp }}/logs
281-
282-
- name: Start Jobrunner
283-
run: |
284-
node --enable-source-maps dist/index.cjs --watch --pidFile ${{ runner.temp }}/jobrunner.pid > ${{ runner.temp }}/logs/jobrunner.log 2>&1 &
285-
npx -y wait-on file:/${{ runner.temp }}/jobrunner.pid
286-
working-directory: ./jobrunner
287-
288-
- name: Start server
289-
run: |
290-
HOSTNAME=localhost node server/server.js > ${{ runner.temp }}/logs/server.log 2>&1 &
291-
npx -y wait-on -v -t 120000 http://localhost:3000/api/healthz
292-
working-directory: ./server/.next/standalone
293-
294-
- name: Run Playwright tests
295-
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn ${{ runner.debug && 'test:e2e:debug' || 'test:e2e' }} --project complete
296-
working-directory: ./desktop
297-
env:
298-
PLAYWRIGHT_HTML_REPORT: ${{ github.workspace }}/desktop/playwright-report
299-
BADGER_LOGS_PATH: ${{ runner.temp }}/logs
300-
301-
- uses: actions/upload-artifact@v3
302-
if: always()
303-
with:
304-
name: playwright-report-desktop
305-
path: |
306-
./desktop/playwright-report/
307-
./desktop/traces/
308-
./desktop/test-results/
309-
${{ runner.temp }}/logs
310-
retention-days: 30

Dockerfile.common

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ FROM base AS build
77
WORKDIR /app
88
COPY ./.yarn/ .yarn/
99
COPY .yarnrc.yml .yarnrc.yml
10-
# desktop needs to be included, even if we're not building it, otherwise yarn install fails
11-
COPY desktop desktop/
1210
COPY server server/
1311
COPY jobrunner jobrunner/
1412
COPY utility utility/

Dockerfile.jobrunner

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ FROM base AS build
77
WORKDIR /app
88
COPY ./.yarn/ .yarn/
99
COPY .yarnrc.yml .yarnrc.yml
10-
COPY desktop desktop/
1110
COPY server server/
1211
COPY jobrunner jobrunner/
1312
COPY utility utility/

Dockerfile.server

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ FROM base AS build
77
WORKDIR /app
88
COPY ./.yarn/ .yarn/
99
COPY .yarnrc.yml .yarnrc.yml
10-
COPY desktop desktop/
1110
COPY server server/
1211
COPY jobrunner jobrunner/
1312
COPY utility utility/

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Badger is made up of three components:
1717

1818
- `server`, a [Next.js](https://nextjs.org/) app which handles the web interface and API
1919
- `jobrunner`, a standalone [Node.js](https://nodejs.org/en/) service which handles the media processing
20-
- `desktop`, a [Electron](https://www.electronjs.org/) app which handles the OBS integration
20+
- `desktop`, a [Electron](https://www.electronjs.org/) app which handles the OBS integration. Desktop lives [in its own repository](https://github.com/badger-media/badger-desktop)
2121

2222
All of these components are written in [TypeScript](https://www.typescriptlang.org/).
2323

@@ -32,7 +32,6 @@ It also interfaces with a few other services:
3232
_If you're looking to set up a development instance, follow the [contributing guide](./CONTRIBUTING.md) instead._
3333

3434
Every release has Docker images published at `ghcr.io/badger-media/badger/server` and `ghcr.io/badger-media/badger/jobrunner`.
35-
We also create Desktop builds (Windows-only for now) in the [releases](https://github.com/ystv/badger/releases) section on GitHub.
3635
There is an example [docker-compose file](./docker-compose-example.yml) in the repository which runs server, jobrunner, and all dependencies.
3736

3837
Server and Jobrunner are configured by setting environment variables. A minimal set (both use the same variables) is:

desktop/.env

Lines changed: 0 additions & 4 deletions
This file was deleted.

desktop/.eslintrc.cjs

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)