Change npm registry to nexus for CI test and enable turbo remote cache (#2535)

* Change npm registry to nexus for CI test

* Change npm registry to nexus for CI test

* Add yarn.lock

* Remove clean step

* Revert to disable yarn.lock file

* Turn NPM Proxy to env

---------

Co-authored-by: Hien To <tominhhien97@gmail.com>
This commit is contained in:
hiento09 2024-04-02 15:34:26 +07:00 committed by GitHub
parent 345c7d58e6
commit 7feaf0b3bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 40 additions and 3551 deletions

View File

@ -40,13 +40,6 @@ jobs:
test-on-macos: test-on-macos:
runs-on: [self-hosted, macOS, macos-desktop] runs-on: [self-hosted, macOS, macos-desktop]
steps: 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 - name: Getting the repo
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -62,9 +55,14 @@ jobs:
- 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-windows: test-on-windows:
if: github.event_name == 'push' if: github.event_name == 'push'
@ -74,15 +72,6 @@ jobs:
antivirus-tools: ['mcafee', 'default-windows-security','bit-defender'] antivirus-tools: ['mcafee', 'default-windows-security','bit-defender']
runs-on: windows-desktop-${{ matrix.antivirus-tools }} runs-on: windows-desktop-${{ matrix.antivirus-tools }}
steps: 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 - name: Getting the repo
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -101,20 +90,17 @@ jobs:
- 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: test-on-windows-pr:
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
runs-on: windows-desktop-default-windows-security runs-on: windows-desktop-default-windows-security
steps: 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 - name: Getting the repo
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -133,18 +119,17 @@ jobs:
- 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-ubuntu: test-on-ubuntu:
runs-on: [self-hosted, Linux, ubuntu-desktop] runs-on: [self-hosted, Linux, ubuntu-desktop]
steps: steps:
- name: "Cleanup build folder"
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
rm -rf ~/.config/jan
- name: Getting the repo - name: Getting the repo
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -162,4 +147,10 @@ jobs:
run: | run: |
export DISPLAY=$(w -h | awk 'NR==1 {print $2}') export DISPLAY=$(w -h | awk 'NR==1 {print $2}')
echo -e "Display ID: $DISPLAY" 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 }}"

View File

@ -53,19 +53,24 @@ build: check-file-counts
clean: clean:
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
powershell -Command "Get-ChildItem -Path . -Include node_modules, .next, dist, build, out -Recurse -Directory | Remove-Item -Recurse -Force" -powershell -Command "Get-ChildItem -Path . -Include node_modules, .next, dist, build, out, .turbo -Recurse -Directory | Remove-Item -Recurse -Force"
powershell -Command "Get-ChildItem -Path . -Include package-lock.json -Recurse -File | Remove-Item -Recurse -Force" -powershell -Command "Get-ChildItem -Path . -Include package-lock.json -Recurse -File | Remove-Item -Recurse -Force"
powershell -Command "Remove-Item -Recurse -Force ./pre-install/*.tgz" -powershell -Command "Get-ChildItem -Path . -Include yarn.lock -Recurse -File | Remove-Item -Recurse -Force"
powershell -Command "Remove-Item -Recurse -Force ./electron/pre-install/*.tgz" -powershell -Command "Remove-Item -Recurse -Force ./pre-install/*.tgz"
powershell -Command "if (Test-Path \"$($env:USERPROFILE)\jan\extensions\") { Remove-Item -Path \"$($env:USERPROFILE)\jan\extensions\" -Recurse -Force }" -powershell -Command "Remove-Item -Recurse -Force ./extensions/*/*.tgz"
-powershell -Command "Remove-Item -Recurse -Force ./electron/pre-install/*.tgz"
-powershell -Command "if (Test-Path \"$($env:USERPROFILE)\jan\extensions\") { Remove-Item -Path \"$($env:USERPROFILE)\jan\extensions\" -Recurse -Force }"
else ifeq ($(shell uname -s),Linux) else ifeq ($(shell uname -s),Linux)
find . -name "node_modules" -type d -prune -exec rm -rf '{}' + find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
find . -name ".next" -type d -exec rm -rf '{}' + find . -name ".next" -type d -exec rm -rf '{}' +
find . -name "dist" -type d -exec rm -rf '{}' + find . -name "dist" -type d -exec rm -rf '{}' +
find . -name "build" -type d -exec rm -rf '{}' + find . -name "build" -type d -exec rm -rf '{}' +
find . -name "out" -type d -exec rm -rf '{}' + find . -name "out" -type d -exec rm -rf '{}' +
find . -name ".turbo" -type d -exec rm -rf '{}' +
find . -name "packake-lock.json" -type f -exec rm -rf '{}' + find . -name "packake-lock.json" -type f -exec rm -rf '{}' +
find . -name "yarn.lock" -type f -exec rm -rf '{}' +
rm -rf ./pre-install/*.tgz rm -rf ./pre-install/*.tgz
rm -rf ./extensions/*/*.tgz
rm -rf ./electron/pre-install/*.tgz rm -rf ./electron/pre-install/*.tgz
rm -rf "~/jan/extensions" rm -rf "~/jan/extensions"
rm -rf "~/.cache/jan*" rm -rf "~/.cache/jan*"
@ -75,8 +80,11 @@ else
find . -name "dist" -type d -exec rm -rf '{}' + find . -name "dist" -type d -exec rm -rf '{}' +
find . -name "build" -type d -exec rm -rf '{}' + find . -name "build" -type d -exec rm -rf '{}' +
find . -name "out" -type d -exec rm -rf '{}' + find . -name "out" -type d -exec rm -rf '{}' +
find . -name ".turbo" -type d -exec rm -rf '{}' +
find . -name "packake-lock.json" -type f -exec rm -rf '{}' + find . -name "packake-lock.json" -type f -exec rm -rf '{}' +
find . -name "yarn.lock" -type f -exec rm -rf '{}' +
rm -rf ./pre-install/*.tgz rm -rf ./pre-install/*.tgz
rm -rf ./extensions/*/*.tgz
rm -rf ./electron/pre-install/*.tgz rm -rf ./electron/pre-install/*.tgz
rm -rf ~/jan/extensions rm -rf ~/jan/extensions
rm -rf ~/Library/Caches/jan* rm -rf ~/Library/Caches/jan*

View File

@ -2,10 +2,12 @@
"$schema": "https://turbo.build/schema.json", "$schema": "https://turbo.build/schema.json",
"pipeline": { "pipeline": {
"build": { "build": {
"outputs": [".dist/**", "*.tgz"] "dependsOn": ["^build"],
"outputs": ["dist/**"]
}, },
"build:publish": { "build:publish": {
"dependsOn": ["^build"] "dependsOn": ["build"],
"outputs": ["**.tgz"]
}, },
"dev": { "dev": {
"cache": false "cache": false

File diff suppressed because it is too large Load Diff