[CI > Test] Initial Add
This commit is contained in:
parent
4b54121c59
commit
55920b6f00
2 changed files with 62 additions and 0 deletions
43
.github/workflows/test_startup.yml
vendored
Normal file
43
.github/workflows/test_startup.yml
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
name: Release Nightly
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'scripts/**'
|
||||
- 'polyfills/**'
|
||||
- '.github/workflows/test_startup.yml'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js v16.x
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
- name: Pack base asar
|
||||
run: |
|
||||
npm i -g asar uglify-js
|
||||
bash scripts/injectPolyfills.sh
|
||||
sed -i -e "s/nightly/nightly-$(git rev-parse HEAD | cut -c 1-7)/" src/index.js
|
||||
|
||||
npx asar pack src app.asar
|
||||
|
||||
- name: Download Discord with OpenAsar
|
||||
run: |
|
||||
wget "https://discord.com/api/download/canary?platform=linux&format=tar.gz" -O discord.tar.gz
|
||||
tar xf discord.tar.gz
|
||||
cp app.asar DiscordCanary/resources/app.asar
|
||||
|
||||
- name: Check if Discord will startup
|
||||
run: |
|
||||
./DiscordCanary/DiscordCanary
|
||||
# node scripts/testStartup.js ./DiscordCanary/DiscordCanary
|
19
scripts/testStartup.js
Normal file
19
scripts/testStartup.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
const { execFile } = require('child_process');
|
||||
|
||||
const test = () => {
|
||||
const proc = execFile(process.argv[2], ['--enable-logging']);
|
||||
|
||||
let success = false;
|
||||
proc.stderr.on('data', (data) => {
|
||||
if (data.toString().includes('FAST CONNECT')) { // Main window JS running, startup success
|
||||
success = true;
|
||||
proc.kill();
|
||||
}
|
||||
});
|
||||
|
||||
proc.on('close', async () => {
|
||||
process.exit(success ? 0 : 1);
|
||||
});
|
||||
};
|
||||
|
||||
test();
|
Loading…
Reference in a new issue