use new action #483
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 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 | |
#cd src | |
#npm install --legacy-peer-deps | |
#npx nyc instrument --compact=false . --in-place | |
- 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 }} | |