Change npm registry to nexus for CI test and enable turbo remote cache #2454
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Jan Electron Linter & Test | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- dev | |
paths: | |
- "electron/**" | |
- .github/workflows/jan-electron-linter-and-test.yml | |
- "web/**" | |
- "uikit/**" | |
- "package.json" | |
- "node_modules/**" | |
- "yarn.lock" | |
- "core/**" | |
- "extensions/**" | |
- "!README.md" | |
- "Makefile" | |
pull_request: | |
branches: | |
- main | |
- dev | |
- release/** | |
paths: | |
- "electron/**" | |
- .github/workflows/jan-electron-linter-and-test.yml | |
- "web/**" | |
- "uikit/**" | |
- "package.json" | |
- "node_modules/**" | |
- "yarn.lock" | |
- "Makefile" | |
- "extensions/**" | |
- "core/**" | |
- "!README.md" | |
jobs: | |
test-on-macos: | |
runs-on: [self-hosted, macOS, macos-desktop] | |
steps: | |
- name: "Cleanup build folder" | |
run: | | |
ls -la ./ | |
rm -rf ./* || true | |
rm -rf ./.??* || true | |
ls -la ./ | |
rm -rf ~/Library/Application\ Support/jan | |
- name: Getting the repo | |
uses: actions/checkout@v3 | |
- name: Installing node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: "Cleanup cache" | |
continue-on-error: true | |
run: | | |
make clean | |
- name: Linter and test | |
run: | | |
npm config set registry https://nexus.jan.ai/repository/jan-npm/ --global | |
yarn config set registry https://nexus.jan.ai/repository/jan-npm/ --global | |
make test | |
env: | |
CSC_IDENTITY_AUTO_DISCOVERY: "false" | |
TURBO_API: "${{ secrets.TURBO_API }}" | |
TURBO_TEAM: "${{ secrets.TURBO_TEAM }}" | |
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}" | |
test-on-windows: | |
if: github.event_name == 'push' | |
strategy: | |
fail-fast: false | |
matrix: | |
antivirus-tools: ['mcafee', 'default-windows-security','bit-defender'] | |
runs-on: windows-desktop-${{ matrix.antivirus-tools }} | |
steps: | |
- name: Clean workspace | |
run: | | |
Remove-Item -Path "\\?\$(Get-Location)\*" -Force -Recurse | |
$path = "$Env:APPDATA\jan" | |
if (Test-Path $path) { | |
Remove-Item "\\?\$path" -Recurse -Force | |
} else { | |
Write-Output "Folder does not exist." | |
} | |
- name: Getting the repo | |
uses: actions/checkout@v3 | |
- name: Installing node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
# Clean cache, continue on error | |
- name: "Cleanup cache" | |
shell: powershell | |
continue-on-error: true | |
run: | | |
make clean | |
- name: Linter and test | |
shell: powershell | |
run: | | |
npm config set registry https://nexus.jan.ai/repository/jan-npm/ --global | |
yarn config set registry https://nexus.jan.ai/repository/jan-npm/ --global | |
make test | |
env: | |
TURBO_API: "${{ secrets.TURBO_API }}" | |
TURBO_TEAM: "${{ secrets.TURBO_TEAM }}" | |
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}" | |
test-on-windows-pr: | |
if: github.event_name == 'pull_request' | |
runs-on: windows-desktop-default-windows-security | |
steps: | |
- name: Clean workspace | |
run: | | |
Remove-Item -Path "\\?\$(Get-Location)\*" -Force -Recurse | |
$path = "$Env:APPDATA\jan" | |
if (Test-Path $path) { | |
Remove-Item "\\?\$path" -Recurse -Force | |
} else { | |
Write-Output "Folder does not exist." | |
} | |
- name: Getting the repo | |
uses: actions/checkout@v3 | |
- name: Installing node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 20 | |
# Clean cache, continue on error | |
- name: "Cleanup cache" | |
shell: powershell | |
continue-on-error: true | |
run: | | |
make clean | |
- name: Linter and test | |
shell: powershell | |
run: | | |
npm config set registry https://nexus.jan.ai/repository/jan-npm/ --global | |
yarn config set registry https://nexus.jan.ai/repository/jan-npm/ --global | |
make test | |
env: | |
TURBO_API: "${{ secrets.TURBO_API }}" | |
TURBO_TEAM: "${{ secrets.TURBO_TEAM }}" | |
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}" | |
test-on-ubuntu: | |
runs-on: [self-hosted, Linux, ubuntu-desktop] | |
steps: | |
- name: "Cleanup build folder" | |
run: | | |
ls -la ./ | |
rm -rf ./* || true | |
rm -rf ./.??* || true | |
ls -la ./ | |
rm -rf ~/.config/jan | |
- name: Getting the repo | |
uses: actions/checkout@v3 | |
- name: Installing node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: "Cleanup cache" | |
continue-on-error: true | |
run: | | |
make clean | |
- name: Linter and test | |
run: | | |
export DISPLAY=$(w -h | awk 'NR==1 {print $2}') | |
echo -e "Display ID: $DISPLAY" | |
npm config set registry https://nexus.jan.ai/repository/jan-npm/ --global | |
yarn config set registry https://nexus.jan.ai/repository/jan-npm/ --global | |
make test | |
env: | |
TURBO_API: "${{ secrets.TURBO_API }}" | |
TURBO_TEAM: "${{ secrets.TURBO_TEAM }}" | |
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}" |