parent
9a266db745
commit
462073276c
171
.github/workflows/jan-electron-linter-and-test.yml
vendored
171
.github/workflows/jan-electron-linter-and-test.yml
vendored
@ -66,11 +66,7 @@ jobs:
|
|||||||
|
|
||||||
test-on-macos:
|
test-on-macos:
|
||||||
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||||
runs-on: ${{ matrix.runs-on }}
|
runs-on: [self-hosted, macOS, macos-desktop]
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
runs-on: ['macos-latest', 'macos-13']
|
|
||||||
steps:
|
steps:
|
||||||
- name: Getting the repo
|
- name: Getting the repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -82,19 +78,40 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
|
- name: 'Cleanup cache'
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
rm -rf ~/jan
|
||||||
|
make clean
|
||||||
|
|
||||||
|
- name: Get Commit Message for PR
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
run: |
|
||||||
|
echo "REPORT_PORTAL_DESCRIPTION=${{github.event.after}})" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Get Commit Message for push event
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
run: |
|
||||||
|
echo "REPORT_PORTAL_DESCRIPTION=${{github.sha}})" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: 'Config report portal'
|
||||||
|
run: |
|
||||||
|
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App macos" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
|
||||||
|
|
||||||
- name: Linter and test
|
- name: Linter and test
|
||||||
run: |
|
run: |
|
||||||
|
npm config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
|
yarn config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
make test
|
make test
|
||||||
env:
|
env:
|
||||||
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
|
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
|
||||||
|
# TURBO_API: '${{ secrets.TURBO_API }}'
|
||||||
|
# TURBO_TEAM: 'macos'
|
||||||
|
# TURBO_TOKEN: '${{ secrets.TURBO_TOKEN }}'
|
||||||
|
|
||||||
test-on-macos-pr-target:
|
test-on-macos-pr-target:
|
||||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
|
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
|
||||||
runs-on: ${{ matrix.runs-on }}
|
runs-on: [self-hosted, macOS, macos-desktop]
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
runs-on: ['macos-latest', 'macos-13']
|
|
||||||
steps:
|
steps:
|
||||||
- name: Getting the repo
|
- name: Getting the repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -106,8 +123,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
|
- name: 'Cleanup cache'
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
rm -rf ~/jan
|
||||||
|
make clean
|
||||||
|
|
||||||
- name: Linter and test
|
- name: Linter and test
|
||||||
run: |
|
run: |
|
||||||
|
npm config set registry https://registry.npmjs.org --global
|
||||||
|
yarn config set registry https://registry.npmjs.org --global
|
||||||
make test
|
make test
|
||||||
env:
|
env:
|
||||||
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
|
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
|
||||||
@ -143,16 +168,30 @@ jobs:
|
|||||||
}
|
}
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
|
- name: Get Commit Message for push event
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "REPORT_PORTAL_DESCRIPTION=${{github.sha}}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: 'Config report portal'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Windows ${{ matrix.antivirus-tools }}" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
|
||||||
|
|
||||||
- name: Linter and test
|
- name: Linter and test
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
npm config set registry ${{ secrets.NPM_PROXY }} --global
|
npm config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
yarn config set registry ${{ secrets.NPM_PROXY }} --global
|
yarn config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
make test
|
make test
|
||||||
|
# env:
|
||||||
|
# TURBO_API: '${{ secrets.TURBO_API }}'
|
||||||
|
# TURBO_TEAM: 'windows'
|
||||||
|
# TURBO_TOKEN: '${{ secrets.TURBO_TOKEN }}'
|
||||||
test-on-windows-pr:
|
test-on-windows-pr:
|
||||||
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
|
||||||
runs-on: windows-latest
|
runs-on: windows-desktop-default-windows-security
|
||||||
steps:
|
steps:
|
||||||
- name: Getting the repo
|
- name: Getting the repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -164,14 +203,44 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
|
# Clean cache, continue on error
|
||||||
|
- name: 'Cleanup cache'
|
||||||
|
shell: powershell
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
$path = "$Env:APPDATA\jan"
|
||||||
|
if (Test-Path $path) {
|
||||||
|
Remove-Item "\\?\$path" -Recurse -Force
|
||||||
|
} else {
|
||||||
|
Write-Output "Folder does not exist."
|
||||||
|
}
|
||||||
|
make clean
|
||||||
|
|
||||||
|
- name: Get Commit Message for PR
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "REPORT_PORTAL_DESCRIPTION=${{github.event.after}}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: 'Config report portal'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Windows" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
|
||||||
|
|
||||||
- name: Linter and test
|
- name: Linter and test
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
|
npm config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
|
yarn config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
make test
|
make test
|
||||||
|
# env:
|
||||||
|
# TURBO_API: '${{ secrets.TURBO_API }}'
|
||||||
|
# TURBO_TEAM: 'windows'
|
||||||
|
# TURBO_TOKEN: '${{ secrets.TURBO_TOKEN }}'
|
||||||
|
|
||||||
test-on-windows-pr-target:
|
test-on-windows-pr-target:
|
||||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
|
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
|
||||||
runs-on: windows-latest
|
runs-on: windows-desktop-default-windows-security
|
||||||
steps:
|
steps:
|
||||||
- name: Getting the repo
|
- name: Getting the repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -183,13 +252,28 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
|
# Clean cache, continue on error
|
||||||
|
- name: 'Cleanup cache'
|
||||||
|
shell: powershell
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
$path = "$Env:APPDATA\jan"
|
||||||
|
if (Test-Path $path) {
|
||||||
|
Remove-Item "\\?\$path" -Recurse -Force
|
||||||
|
} else {
|
||||||
|
Write-Output "Folder does not exist."
|
||||||
|
}
|
||||||
|
make clean
|
||||||
|
|
||||||
- name: Linter and test
|
- name: Linter and test
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
|
npm config set registry https://registry.npmjs.org --global
|
||||||
|
yarn config set registry https://registry.npmjs.org --global
|
||||||
make test
|
make test
|
||||||
|
|
||||||
test-on-ubuntu:
|
test-on-ubuntu:
|
||||||
runs-on: ubuntu-latest
|
runs-on: [self-hosted, Linux, ubuntu-desktop]
|
||||||
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||||
steps:
|
steps:
|
||||||
- name: Getting the repo
|
- name: Getting the repo
|
||||||
@ -202,12 +286,41 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
|
- name: 'Cleanup cache'
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
rm -rf ~/jan
|
||||||
|
make clean
|
||||||
|
|
||||||
|
- name: Get Commit Message for PR
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
run: |
|
||||||
|
echo "REPORT_PORTAL_DESCRIPTION=${{github.event.after}}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Get Commit Message for push event
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
run: |
|
||||||
|
echo "REPORT_PORTAL_DESCRIPTION=${{github.sha}}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: 'Config report portal'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Linux" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
|
||||||
|
|
||||||
- name: Linter and test
|
- name: Linter and test
|
||||||
run: |
|
run: |
|
||||||
|
export DISPLAY=$(w -h | awk 'NR==1 {print $2}')
|
||||||
|
echo -e "Display ID: $DISPLAY"
|
||||||
|
npm config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
|
yarn config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
make test
|
make test
|
||||||
|
# env:
|
||||||
|
# TURBO_API: '${{ secrets.TURBO_API }}'
|
||||||
|
# TURBO_TEAM: 'linux'
|
||||||
|
# TURBO_TOKEN: '${{ secrets.TURBO_TOKEN }}'
|
||||||
|
|
||||||
coverage-check:
|
coverage-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: [self-hosted, Linux, ubuntu-desktop]
|
||||||
needs: base_branch_cov
|
needs: base_branch_cov
|
||||||
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||||
steps:
|
steps:
|
||||||
@ -221,6 +334,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
|
- name: 'Cleanup cache'
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
rm -rf ~/jan
|
||||||
|
make clean
|
||||||
|
|
||||||
- name: Download code coverage report from base branch
|
- name: Download code coverage report from base branch
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
@ -228,9 +347,17 @@ jobs:
|
|||||||
|
|
||||||
- name: Linter and test coverage
|
- name: Linter and test coverage
|
||||||
run: |
|
run: |
|
||||||
|
export DISPLAY=$(w -h | awk 'NR==1 {print $2}')
|
||||||
|
echo -e "Display ID: $DISPLAY"
|
||||||
|
npm config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
|
yarn config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
make lint
|
make lint
|
||||||
yarn build:test
|
yarn build:test
|
||||||
yarn test:coverage
|
yarn test:coverage
|
||||||
|
# env:
|
||||||
|
# TURBO_API: '${{ secrets.TURBO_API }}'
|
||||||
|
# TURBO_TEAM: 'linux'
|
||||||
|
# TURBO_TOKEN: '${{ secrets.TURBO_TOKEN }}'
|
||||||
|
|
||||||
- name: Generate Code Coverage report
|
- name: Generate Code Coverage report
|
||||||
id: code-coverage
|
id: code-coverage
|
||||||
@ -243,7 +370,7 @@ jobs:
|
|||||||
show-annotations: 'warning'
|
show-annotations: 'warning'
|
||||||
|
|
||||||
test-on-ubuntu-pr-target:
|
test-on-ubuntu-pr-target:
|
||||||
runs-on: ubuntu-latest
|
runs-on: [self-hosted, Linux, ubuntu-desktop]
|
||||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
|
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
|
||||||
steps:
|
steps:
|
||||||
- name: Getting the repo
|
- name: Getting the repo
|
||||||
@ -256,6 +383,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
|
- name: 'Cleanup cache'
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
rm -rf ~/jan
|
||||||
|
make clean
|
||||||
|
|
||||||
- name: Linter and test
|
- name: Linter and test
|
||||||
run: |
|
run: |
|
||||||
|
export DISPLAY=$(w -h | awk 'NR==1 {print $2}')
|
||||||
|
echo -e "Display ID: $DISPLAY"
|
||||||
|
npm config set registry https://registry.npmjs.org --global
|
||||||
|
yarn config set registry https://registry.npmjs.org --global
|
||||||
make test
|
make test
|
||||||
|
|||||||
@ -77,7 +77,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint . --ext \".js,.jsx,.ts,.tsx\"",
|
"lint": "eslint . --ext \".js,.jsx,.ts,.tsx\"",
|
||||||
"test:e2e": "xvfb-maybe -- playwright test --workers=1",
|
"test:e2e": "playwright test --workers=1",
|
||||||
"copy:assets": "rimraf --glob \"./pre-install/*.tgz\" && cpx \"../pre-install/*.tgz\" \"./pre-install\"",
|
"copy:assets": "rimraf --glob \"./pre-install/*.tgz\" && cpx \"../pre-install/*.tgz\" \"./pre-install\"",
|
||||||
"dev": "yarn copy:assets && tsc -p . && electron .",
|
"dev": "yarn copy:assets && tsc -p . && electron .",
|
||||||
"compile": "tsc -p .",
|
"compile": "tsc -p .",
|
||||||
@ -128,8 +128,7 @@
|
|||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
"run-script-os": "^1.1.6",
|
"run-script-os": "^1.1.6",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.3.3",
|
||||||
"@reportportal/agent-js-playwright": "^5.1.7",
|
"@reportportal/agent-js-playwright": "^5.1.7"
|
||||||
"xvfb-maybe": "^0.2.1"
|
|
||||||
},
|
},
|
||||||
"installConfig": {
|
"installConfig": {
|
||||||
"hoistingLimits": "workspaces"
|
"hoistingLimits": "workspaces"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user