Skip to content

Fix locals packages list #1515

Fix locals packages list

Fix locals packages list #1515

name: Run tests and TICS report
on:
pull_request:
branches: [main]
jobs:
e2e-tests:
name: e2e-tests (${{ matrix.target }})
runs-on: [self-hosted, Linux, large]
container:
image: mcr.microsoft.com/playwright:v1.45.1
environment: dev
strategy:
fail-fast: false
matrix:
include:
- target: saas
self_hosted_env: "false"
msw_enabled: "false"
- target: self-hosted
self_hosted_env: "true"
msw_enabled: "false"
env:
VITE_API_URL: ${{ vars.API_URL }}
VITE_API_URL_OLD: ${{ vars.API_URL_OLD }}
VITE_API_URL_DEB_ARCHIVE: ${{ vars.API_URL_DEB_ARCHIVE }}
VITE_API_PROXY_TARGET: ${{ vars.API_PROXY_TARGET }}
VITE_APP_TITLE: Landscape
VITE_ROOT_PATH: /
VITE_REPORT_VIEW_ENABLED: true
VITE_DETAILED_UPGRADES_VIEW_ENABLED: true
VITE_APP_VERSION: "26.04.0.12"
VITE_APP_COMMIT: "abcd123"
VITE_SELF_HOSTED_ENV: ${{ matrix.self_hosted_env }}
VITE_MSW_ENABLED: ${{ matrix.msw_enabled }}
DEBUG: "pw:webserver"
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build the project
run: pnpm run build:e2e
env:
VITE_ROOT_PATH: /
VITE_MSW_ENABLED: ${{ matrix.msw_enabled }}
VITE_SELF_HOSTED_ENV: ${{ matrix.self_hosted_env }}
- name: Install Playwright browsers
run: pnpm exec playwright install --with-deps
- name: Run ${{ matrix.target }} tests
run: pnpm exec playwright test --project=${{ matrix.target }}
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.target }}
path: playwright-report
retention-days: 30
unit-tests:
runs-on: [self-hosted, Linux, large]
permissions:
contents: read
pull-requests: write
environment: dev
env:
VITE_API_URL: ${{ vars.API_URL }}
VITE_API_URL_OLD: ${{ vars.API_URL_OLD }}
VITE_API_URL_DEB_ARCHIVE: ${{ vars.API_URL_DEB_ARCHIVE }}
VITE_API_PROXY_TARGET: ${{ vars.API_PROXY_TARGET }}
VITE_APP_TITLE: Landscape
VITE_ROOT_PATH: /new_dashboard/
VITE_REPORT_VIEW_ENABLED: false
VITE_DETAILED_UPGRADES_VIEW_ENABLED: false
VITE_APP_VERSION: "26.04.0.12"
VITE_APP_COMMIT: ${{ github.sha }}
VITE_SELF_HOSTED_ENV: true
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests with coverage
run: pnpm exec vitest run --coverage
env:
NODE_OPTIONS: "--max_old_space_size=4096"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: vitest-report
path: ${{ github.workspace }}/reports
retention-days: 30
tics-report:
runs-on: ubuntu-latest
needs: unit-tests
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Download coverage report artifact
uses: actions/download-artifact@v4
with:
name: vitest-report
path: ${{ github.workspace }}/reports
- name: TICS report
uses: tiobe/tics-github-action@v3
with:
project: landscape-ui
viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default
ticsAuthToken: ${{ secrets.TICSAUTHTOKEN }}
installTics: true