Merge pull request #463 from pulsar-edit/build-and-test

Build first, and test later
This commit is contained in:
Maurício Szabo 2023-04-06 11:06:35 -03:00 committed by GitHub
commit 43764b8b4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 12 deletions

View File

@ -10,6 +10,7 @@ linux_task:
- apt-get update
- export DEBIAN_FRONTEND="noninteractive"
- apt-get install -y
ffmpeg
rpm
build-essential
git
@ -27,7 +28,7 @@ linux_task:
- git submodule update
- sed -i -e "s/[0-9]*-dev/`date -u +%Y%m%d%H`/g" package.json
install_script:
- yarn install || yarn install
- yarn install --ignore-engines || yarn install --ignore-engines
build_script:
- yarn build
- yarn run build:apm
@ -36,7 +37,11 @@ linux_task:
binary_artifacts:
path: ./binaries/*
test_script:
- Xvfb :99 & DISPLAY=:99 PLAYWRIGHT_JUNIT_OUTPUT_NAME=report.xml npx playwright test --reporter=junit,list
- rm -R node_modules/electron; yarn install --check-files
- ./binaries/*AppImage --appimage-extract
- export BINARY_NAME='squashfs-root/pulsar'
- mkdir -p ./tests/videos
- Xvfb -screen 0 1024x768x24+32 :99 & nohup ffmpeg -video_size 1024x768 -f x11grab -i :99.0 ./tests/videos/out.mpg & DISPLAY=:99 PLAYWRIGHT_JUNIT_OUTPUT_NAME=report.xml npx playwright test --reporter=junit,list
always:
videos_artifacts:
path: ./tests/videos/**
@ -81,17 +86,19 @@ arm_linux_task:
- git submodule update
- sed -i -e "s/[0-9]*-dev/`date -u +%Y%m%d%H`/g" package.json
install_script:
- yarn install || yarn install
- yarn install --ignore-engines || yarn install --ignore-engines
build_script:
- yarn build
- yarn run build:apm
- rm -Rf node-modules/electron && yarn install --check-files
build_binary_script:
- source /etc/profile.d/rvm.sh
- yarn dist || yarn dist
binary_artifacts:
path: ./binaries/*
test_script:
- rm -R node_modules/electron; yarn install --check-files
- ./binaries/*AppImage --appimage-extract
- export BINARY_NAME='squashfs-root/pulsar'
- Xvfb :99 & DISPLAY=:99 PLAYWRIGHT_JUNIT_OUTPUT_NAME=report.xml npx playwright test --reporter=junit,list
always:
videos_artifacts:
@ -121,7 +128,7 @@ silicon_mac_task:
- sed -i -e "s/[0-9]*-dev/`date -u +%Y%m%d%H`/g" package.json
install_script:
- export PATH="/opt/homebrew/bin:/opt/homebrew/opt/node@16/bin:$PATH"
- yarn install || yarn install
- yarn install --ignore-engines || yarn install --ignore-engines
build_script:
- export PATH="/opt/homebrew/bin:/opt/homebrew/opt/node@16/bin:$PATH"
- yarn build
@ -133,6 +140,9 @@ silicon_mac_task:
path: ./binaries/*
test_script:
- export PATH="/opt/homebrew/bin:/opt/homebrew/opt/node@16/bin:$PATH"
- rm -R node_modules/electron; yarn install --check-files
- hdiutil mount binaries/Pulsar*dmg
- export BINARY_NAME=`ls /Volumes/Pulsar*/Pulsar.app/Contents/MacOS/Pulsar`
- PLAYWRIGHT_JUNIT_OUTPUT_NAME=report.xml npx playwright test --reporter=junit,list
always:
videos_artifacts:
@ -166,7 +176,7 @@ intel_mac_task:
- sed -i -e "s/[0-9]*-dev/`date -u +%Y%m%d%H`/g" package.json
install_script:
- export PATH="/usr/local/opt/node@16/bin:/usr/local/bin:$PATH"
- arch -x86_64 npx yarn install || arch -x86_64 npx yarn install
- arch -x86_64 npx yarn install --ignore-engines || arch -x86_64 npx yarn install --ignore-engines
build_script:
- export PATH="/usr/local/opt/node@16/bin:/usr/local/bin:$PATH"
- arch -x86_64 npx yarn build
@ -178,6 +188,9 @@ intel_mac_task:
path: ./binaries/*
test_script:
- export PATH="/usr/local/opt/node@16/bin:/usr/local/bin:$PATH"
- rm -R node_modules/electron; yarn install --check-files
- hdiutil mount binaries/Pulsar*dmg
- export BINARY_NAME=`ls /Volumes/Pulsar*/Pulsar.app/Contents/MacOS/Pulsar`
- PLAYWRIGHT_JUNIT_OUTPUT_NAME=report.xml arch -x86_64 npx playwright test --reporter=junit,list
always:
videos_artifacts:
@ -189,20 +202,23 @@ intel_mac_task:
windows_task:
alias: windows
timeout_in: 90m
windows_container:
image: cirrusci/windowsservercore:visualstudio2022-2022.06.23
env:
CIRRUS_SHELL: bash
PATH: C:\Python310\Scripts\;C:\Python310\;%PATH%;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\Users\User\AppData\Roaming\npm;C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\
prepare_script:
- choco install nodejs --version=14.15.0 -y
- choco install nodejs --version=16.16.0 -y
- choco install python --version=3.10.3 -y
- choco install git visualstudio2019-workload-vctools -y
- git submodule init
- git submodule update
- npm config set python 'C:\Python310\python.exe'
install_script:
- npx yarn install --ignore-engines || sleep 1 && npx yarn install --ignore-engines || echo "There is a reason for so many tries"
- npx yarn install --ignore-engines
|| rm -R node_modules && npx yarn install --ignore-engines
|| rm -R node_modules && npx yarn install --ignore-engines
build_script:
- npx yarn build:apm
- npx yarn build || npx yarn build || npx yarn build
@ -211,3 +227,14 @@ windows_task:
- npx yarn dist || npx yarn dist || npx yarn dist
binary_artifacts:
path: .\binaries\*
test_script:
- mkdir extracted; tar -xf binaries/*zip -C ./extracted/
- export BINARY_NAME=./extracted/Pulsar.exe
- PLAYWRIGHT_JUNIT_OUTPUT_NAME=report.xml npx playwright test --reporter=junit,list || echo "Yeah, tests failed, Windows is like this"
always:
videos_artifacts:
path: ./tests/videos/**
junit_artifacts:
path: report.xml
type: text/xml
format: junit

View File

@ -14,6 +14,11 @@ async function openAtom(profilePath, videoName) {
env: env,
timeout: 50000
}
if(env.BINARY_NAME) {
config.executablePath = env.BINARY_NAME
config.args = ["--no-sandbox"]
}
if(process.env.CI) {
config.recordVideo = {
dir: path.join('tests', 'videos', videoName)

View File

@ -37,8 +37,6 @@ async function modifyMainPackageJson(file, extraMetadata, isRemovePackageScripts
/// END Monkey-Patch
const builder = require("electron-builder")
const Platform = builder.Platform
const pngIcon = 'resources/app-icons/beta.png'
const icoIcon = 'resources/app-icons/beta.ico'
@ -220,7 +218,7 @@ let options = {
],
"target": [
{ "target": "nsis" },
{ "target": "portable" },
{ target: "zip" },
],
},
// Windows NSIS Configuration
@ -263,7 +261,6 @@ async function main() {
let options = whatToBuild()
options.extraMetadata = generateMetadata(JSON.parse(package))
builder.build({
//targets: Platform.LINUX.createTarget(),
config: options
}).then((result) => {
console.log("Built binaries")