Skip to content

fix: test compatibility issues (#3081) #941

fix: test compatibility issues (#3081)

fix: test compatibility issues (#3081) #941

name: Application Unit Tests
on:
push:
concurrency:
cancel-in-progress: true
group: "${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }}"
env:
NODE_ENV: test
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for better SonarCloud analysis
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
with:
run_install: false
- name: Install dependencies
run: |
pnpm install --frozen-lockfile
- name: Build code
run: |
pnpm build:app
- name: Cache build
uses: actions/cache@v4
with:
path: ./*
key: "${{ github.sha }}"
test:
name: Execution Tests
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for better SonarCloud analysis
- name: Restore build
uses: actions/cache@v4
with:
path: ./*
key: "${{ github.sha }}"
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
with:
run_install: false
- name: Test App
run: |
pnpm test:app
# Debug - check if coverage file exists
ls -la packages/app/coverage/
cat packages/app/coverage/lcov.info | head -n 20
- name: SonarQube Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: .