Skip to content

debug

debug #484

name: Cypress and Execute Tests
on:
workflow_dispatch: {}
push:
branches: ['test', 'cypress/*']
env:
DASHBOARD_PROJECT_ID: ${{ secrets.CY_DASHBOARD_PRJ_ID }}
DASHBOARD_RECORD_KEY: ${{ secrets.CY_DASHBOARD_RECORD_KEY }}
EXECUTION_ENV: prod
GIT_COMMIT_BRANCH: ${{ github.ref_name }}
GIT_COMMIT_SHA: ${{ github.sha }}
GIT_COMMIT_AUTHOR: ${{ github.actor }}
GIT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
GIT_REPO_URL: ${{ github.repository }}
jobs:
cypress-run:
runs-on: ubuntu-latest
steps:
- name: Checkout Portal
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Verify LCOV File
run: |
echo "Checking if lcov.info exists..."
ls -lah ./e2e/lcov.info || echo "lcov.info is missing!"
cat ./e2e/lcov.info | head -n 5 # Show first 5 lines
- name: Instrument the code for coverage analysis
run: |
# Rewrite the paths as the coverage starts with '../app'!
sed -e 's#../app#.#g' ./e2e/lcov.info > lcov.info
echo "Updated lcov.info:"
cat lcov.info | head -n 5 # Show first 5 lines
- name: Look at files in github/workspace
run: |
# Rewrite the paths as the coverage starts with '../app'!
ls -lah
cat /github/workspace/lcov.info | head -n 5 # Show first 5 lines
- name: SonarCloud Scan
uses: sonarsource/sonarqube-scan-action@master
with:
args: >
-Dsonar.organization=bcgov-oss
-Dsonar.projectKey=aps-portal-e2e
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.projectBaseDir=src
-Dsonar.sources=.
-Dsonar.exclusions=nextapp/**,mocks/**,test/**,tools/**,*.json,*.js
-Dsonar.javascript.lcov.reportPaths=/github/workspace/lcov.info
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}