Skip to content

Commit

Permalink
test workflow to release
Browse files Browse the repository at this point in the history
  • Loading branch information
niuniuland committed Nov 20, 2023
1 parent 1e0cb93 commit 4f6a557
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 103 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ on:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true

env:
VITE_APP_API: https://api.chromepower.xyz/api
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }}
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }}

defaults:
run:
Expand Down
64 changes: 32 additions & 32 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name: Tests
on: [ workflow_call ]
# name: Tests
# on: [ workflow_call ]

concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
# concurrency:
# group: tests-${{ github.ref }}
# cancel-in-progress: true

defaults:
run:
shell: 'bash'
# defaults:
# run:
# shell: 'bash'

jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [ windows-latest, ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- uses: actions/setup-node@v3
with:
cache: 'npm'
- run: npm ci
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: npm run test:main --if-present
- run: npm run test:preload --if-present
- run: npm run test:renderer --if-present
# jobs:
# tests:
# strategy:
# fail-fast: false
# matrix:
# os: [ windows-latest, ubuntu-latest, macos-latest ]
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
# - uses: actions/setup-node@v3
# with:
# cache: 'npm'
# - run: npm ci
# env:
# PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
# - run: npm run test:main --if-present
# - run: npm run test:preload --if-present
# - run: npm run test:renderer --if-present

# I ran into problems trying to run an electron window in ubuntu due to a missing graphics server.
# That's why this special command for Ubuntu is here
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:e2e --if-present
if: matrix.os == 'ubuntu-latest'
# # I ran into problems trying to run an electron window in ubuntu due to a missing graphics server.
# # That's why this special command for Ubuntu is here
# - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:e2e --if-present
# if: matrix.os == 'ubuntu-latest'

- run: npm run test:e2e --if-present
if: matrix.os != 'ubuntu-latest'
# - run: npm run test:e2e --if-present
# if: matrix.os != 'ubuntu-latest'
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"main": "packages/main/dist/index.cjs",
"scripts": {
"build:native-addon": "cd ./packages/main/src/native-addon && node-gyp configure && node-gyp build",
"build": "npm run build:main && npm run build:preload && npm run build:renderer",
"build": "npm run rebuild && npm run build:main && npm run build:preload && npm run build:renderer",
"build:main": "cd ./packages/main && vite build",
"build:preload": "cd ./packages/preload && vite build",
"build:renderer": "cd ./packages/renderer && vite build",
Expand Down Expand Up @@ -54,7 +54,7 @@
"postcss-loader": "^7.3.3",
"simple-git-hooks": "2.9.0",
"tailwindcss": "^3.3.3",
"typescript": "5.2.2",
"typescript": "5.1.3",
"unplugin-auto-expose": "0.0.5",
"vite": "4.4.9",
"vite-plugin-windicss": "^1.9.1",
Expand Down
7 changes: 4 additions & 3 deletions packages/main/src/sync/tile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import type {SafeAny} from '../../../shared/types/db';

let windowAddon: unknown;

if (process.env.NODE_ENV === 'development') {
console.log(process.env.NODE_ENV);
if (process.env.NODE_ENV === 'production') {
windowAddon = require('../native-addon/build/Release/window-addon.node');
} else {
const path = require('path');
windowAddon = require(path.join(
__dirname,
'../src/native-addon/build/Release/window-addon.node',
));
} else {
windowAddon = require('../native-addon/build/Release/window-addon.node');
}
export const tileWindows = async () => {
(windowAddon as unknown as SafeAny)!.tileChromeWindows();
Expand Down
23 changes: 0 additions & 23 deletions packages/renderer/tests/ElectronVersions.spec.ts

This file was deleted.

14 changes: 0 additions & 14 deletions packages/renderer/tests/ReactiveCounter.spec.ts

This file was deleted.

21 changes: 0 additions & 21 deletions packages/renderer/tests/ReactiveHash.spec.ts

This file was deleted.

0 comments on commit 4f6a557

Please sign in to comment.