Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(): upgrade to electron@19 + add e2e tests #1

Merged
merged 39 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f3acecd
playwright
ShaMan123 Nov 29, 2024
96d76db
ci
ShaMan123 Nov 29, 2024
fb6c557
ci(): try fixing by using try electron fuses
ShaMan123 Nov 29, 2024
8ac8596
xvfb-run
ShaMan123 Nov 29, 2024
3fbf772
runAsNode
ShaMan123 Nov 29, 2024
dc033e5
beta version
ShaMan123 Nov 29, 2024
83e38bc
disable fuses
ShaMan123 Nov 29, 2024
12da345
headed
ShaMan123 Dec 1, 2024
fd1eab8
fine tune packages
ShaMan123 Dec 1, 2024
1d73617
triage(): rm `--headed` flag
ShaMan123 Dec 1, 2024
5b02c48
triage(): `nativeWindowOpen: false`
ShaMan123 Dec 1, 2024
7b6ab50
waitForIteration
ShaMan123 Dec 1, 2024
d8bcb12
Revert "triage(): `nativeWindowOpen: false`"
ShaMan123 Dec 1, 2024
be7d3f2
increase timeout
ShaMan123 Dec 1, 2024
5c934aa
screenshot
ShaMan123 Dec 1, 2024
3b9a7e4
snapshots
ShaMan123 Dec 1, 2024
952fe86
video
ShaMan123 Dec 1, 2024
fd1ecff
fix(): https://github.com/electron/electron/issues/18397
ShaMan123 Dec 1, 2024
05efc01
bump to electron@19
ShaMan123 Dec 1, 2024
a8e614e
snaps
ShaMan123 Dec 1, 2024
e8df6db
cleanup
ShaMan123 Dec 1, 2024
fe3d794
cleanup2
ShaMan123 Dec 1, 2024
0c5b153
robot
ShaMan123 Dec 2, 2024
0a7af36
downgrade [email protected] to match [email protected]
ShaMan123 Dec 2, 2024
f0097ac
increase timeout
ShaMan123 Dec 2, 2024
a3818fb
back to playwright@latest
ShaMan123 Dec 2, 2024
0e4a8e6
increase timeout
ShaMan123 Dec 2, 2024
32f05e9
revert timeout
ShaMan123 Dec 2, 2024
3329768
prepare robot
ShaMan123 Dec 2, 2024
ddd534b
try building
ShaMan123 Dec 2, 2024
2019383
os yml
ShaMan123 Dec 2, 2024
29a7ec9
ci fixes
ShaMan123 Dec 2, 2024
fa25ca7
try show bg page
ShaMan123 Dec 2, 2024
0b0ab77
disable chromium download
ShaMan123 Dec 2, 2024
0b04b18
fix?
ShaMan123 Dec 2, 2024
e155a92
disable workflows
ShaMan123 Dec 2, 2024
1ea7e14
revert copying files
ShaMan123 Dec 2, 2024
58775a5
upload path
ShaMan123 Dec 2, 2024
e128ec5
config
ShaMan123 Dec 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 60 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: build
on:
push:
# enable next line to limit branches to run
branches: [ "master" ]
branches: ["master"]
pull_request:
# enable next line to limit branches to run
# branches: [ "master" ]
Expand All @@ -12,32 +12,64 @@ jobs:
build:
strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
os: [windows-2022, ubuntu-22.04]
# os: [windows-2022, ubuntu-latest]
os: [ubuntu-latest]
flavor: [test, prod]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

# not needed currently, but leaving here for future use
# - uses: actions/setup-python@v4
# with:
# python-version: '2.7.18'

- name: boost
if: startsWith(matrix.os,'ubuntu')
run: sudo apt-get update && sudo apt-get install -yq libboost-dev

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Build
run: |
npm install
npm run build
- name: Package
run: |
npm run dist
- uses: actions/checkout@v4
with:
submodules: recursive

# not needed currently, but leaving here for future use
# - uses: actions/setup-python@v4
# with:
# python-version: '2.7.18'

- name: boost
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install -yq libboost-dev

- uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node-version }}

- name: Change entry point
if: matrix.flavor == 'test'
run: |
json=$(node -p "JSON.stringify({...require('./package.json'), main: 'main.test.js' }, null, 2)")
echo $json > package.json

- name: Build
run: |
npm ci
npm run build

- name: Package
run: |
npx @electron/packager . deepnest --out dist

- name: Upload
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.flavor }}-${{ matrix.os }}
path: dist/
retention-days: 1

- name: Run app
if: matrix.flavor == 'test'
run: |
appName=$(ls dist | head -1)
# copy input files
# cp -R ./input ./dist/$appName/resources/app
# make executable and run
chmod +x ./dist/$appName/deepnest
xvfb-run ./dist/$appName/deepnest

- name: Upload results
if: matrix.flavor == 'test'
uses: actions/upload-artifact@v4
with:
name: nesting-results-${{ matrix.os }}
path: /home/runner/nesting-*/
retention-days: 1
35 changes: 35 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Playwright Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
if: false
strategy:
matrix:
os: [ubuntu-latest]
timeout-minutes: 5
runs-on: ${{ matrix.os }}
steps:
- name: boost
if: startsWith(matrix.os,'ubuntu')
run: sudo apt-get update && sudo apt-get install -yq libboost-dev
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
# with:
# node-version: 14
# - run: npm i -g npm@8
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium
- name: Run Playwright tests
run: xvfb-run npm test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 1
34 changes: 34 additions & 0 deletions .github/workflows/robot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Robot
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
exec:
if: false
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 5
steps:
- name: boost
run: sudo apt-get update && sudo apt-get install -yq libboost-dev
# - name: Install chromium
# if: matrix.os == 'ubuntu-20.04'
# # https://launchpad.net/ubuntu/+source/chromium-browser/101.0.4951.64-0ubuntu0.18.04.1
# run: sudo apt-get install chromium-browser=101.0.4951.64
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Run robot
run: xvfb-run npm run exec
- uses: actions/upload-artifact@v4
with:
name: nesting
path: /home/runner/
retention-days: 1
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
/bin
/minkowski
/deepnest-*win32-x64
package-lock.json
/output
# package-lock.json
git_token.rtf
.idea
*.zip
.python-version
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# *
# !/tests/*
main/
main.js
16 changes: 16 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"input": "./input",
"output": null,
"timeout": 60000,
"sheet": {
"width": 3000,
"height": 1000
},
"units": "mm",
"spacing": 4,
"rotations": 4,
"threads": 4,
"populationSize": 10,
"mutationRate": 10,
"placementType": "gravity"
}
Loading
Loading