* Add make script for report portual playwright agent config * Update workflow to report to report portal --------- Co-authored-by: Hien To <tominhhien97@gmail.com>
306 lines
9.6 KiB
YAML
306 lines
9.6 KiB
YAML
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:
|
|
if: github.event.pull_request.head.repo.full_name == github.repository
|
|
runs-on: [self-hosted, macOS, macos-desktop]
|
|
steps:
|
|
- name: Getting the repo
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Installing node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: "Cleanup cache"
|
|
continue-on-error: true
|
|
run: |
|
|
make clean
|
|
|
|
- name: Get Commit Message for PR
|
|
if : github.event_name == 'pull_request'
|
|
run: |
|
|
MSG=$(git log --format=%B -n 1 ${{github.event.after}})
|
|
echo "COMMIT_MESSAGE=${MSG}" >> $GITHUB_ENV
|
|
|
|
- name: Get Commit Message for push event
|
|
if : github.event_name == 'push'
|
|
run: |
|
|
MSG=$(git log --format=%B -n 1 ${{github.sha}})
|
|
echo "COMMIT_MESSAGE=${MSG}" >> $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.COMMIT_MESSAGE}}"
|
|
|
|
- name: Linter and test
|
|
run: |
|
|
npm config set registry ${{ secrets.NPM_PROXY }} --global
|
|
yarn config set registry ${{ secrets.NPM_PROXY }} --global
|
|
make test
|
|
env:
|
|
CSC_IDENTITY_AUTO_DISCOVERY: "false"
|
|
TURBO_API: "${{ secrets.TURBO_API }}"
|
|
TURBO_TEAM: "macos"
|
|
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
|
|
|
|
test-on-macos-pr-target:
|
|
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
|
|
runs-on: [self-hosted, macOS, macos-desktop]
|
|
steps:
|
|
- name: Getting the repo
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- 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://registry.npmjs.org --global
|
|
yarn config set registry https://registry.npmjs.org --global
|
|
make test
|
|
env:
|
|
CSC_IDENTITY_AUTO_DISCOVERY: "false"
|
|
|
|
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: Getting the repo
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- 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: Get Commit Message for push event
|
|
if : github.event_name == 'push'
|
|
shell: bash
|
|
run: |
|
|
MSG=$(git log --format=%B -n 1 ${{github.sha}})
|
|
echo "COMMIT_MESSAGE=${MSG}" >> $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.COMMIT_MESSAGE}}"
|
|
|
|
- name: Linter and test
|
|
shell: powershell
|
|
run: |
|
|
npm config set registry ${{ secrets.NPM_PROXY }} --global
|
|
yarn config set registry ${{ secrets.NPM_PROXY }} --global
|
|
make test
|
|
env:
|
|
TURBO_API: "${{ secrets.TURBO_API }}"
|
|
TURBO_TEAM: "windows"
|
|
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
|
|
test-on-windows-pr:
|
|
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
|
|
runs-on: windows-desktop-default-windows-security
|
|
steps:
|
|
- name: Getting the repo
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- 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: Get Commit Message for PR
|
|
if : github.event_name == 'pull_request'
|
|
shell: bash
|
|
run: |
|
|
MSG=$(git log --format=%B -n 1 ${{github.event.after}})
|
|
echo "COMMIT_MESSAGE=${MSG}" >> $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.COMMIT_MESSAGE}}"
|
|
|
|
- name: Linter and test
|
|
shell: powershell
|
|
run: |
|
|
npm config set registry ${{ secrets.NPM_PROXY }} --global
|
|
yarn config set registry ${{ secrets.NPM_PROXY }} --global
|
|
make test
|
|
env:
|
|
TURBO_API: "${{ secrets.TURBO_API }}"
|
|
TURBO_TEAM: "windows"
|
|
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
|
|
|
|
test-on-windows-pr-target:
|
|
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
|
|
runs-on: windows-desktop-default-windows-security
|
|
steps:
|
|
- name: Getting the repo
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- 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://registry.npmjs.org --global
|
|
yarn config set registry https://registry.npmjs.org --global
|
|
make test
|
|
|
|
|
|
test-on-ubuntu:
|
|
runs-on: [self-hosted, Linux, ubuntu-desktop]
|
|
if: github.event.pull_request.head.repo.full_name == github.repository
|
|
steps:
|
|
- name: Getting the repo
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Installing node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: "Cleanup cache"
|
|
continue-on-error: true
|
|
run: |
|
|
make clean
|
|
|
|
- name: Get Commit Message for PR
|
|
if : github.event_name == 'pull_request'
|
|
run: |
|
|
MSG=$(git log --format=%B -n 1 ${{github.event.after}})
|
|
echo "COMMIT_MESSAGE=${MSG}" >> $GITHUB_ENV
|
|
|
|
- name: Get Commit Message for push event
|
|
if : github.event_name == 'push'
|
|
run: |
|
|
MSG=$(git log --format=%B -n 1 ${{github.sha}})
|
|
echo "COMMIT_MESSAGE=${MSG}" >> $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.COMMIT_MESSAGE}}"
|
|
|
|
- name: Linter and test
|
|
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
|
|
env:
|
|
TURBO_API: "${{ secrets.TURBO_API }}"
|
|
TURBO_TEAM: "linux"
|
|
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
|
|
|
|
test-on-ubuntu-pr-target:
|
|
runs-on: [self-hosted, Linux, ubuntu-desktop]
|
|
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
|
|
steps:
|
|
- name: Getting the repo
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- 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://registry.npmjs.org --global
|
|
yarn config set registry https://registry.npmjs.org --global
|
|
make test |