Update cypress_tests.yml #15
Workflow file for this run
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: Node.js CI test 3 | ||
on: | ||
push: | ||
pull_request: | ||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run test-headless | ||
- name: Check coverage | ||
run: | ||
COVERAGE=$(npx nyc report --reporter=text-summary | grep 'All files' | cut -d '|' -f 5 | sed 's/%//') | ||
echo "Coverage: $COVERAGE" | ||
node -e "if ($COVERAGE < 80) { console.log('Code coverage is less than 80%'); process.exit(1); }" | ||
cypress-run: | ||
needs: build | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Cypress run | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
build: npm run build | ||
start: npm start | ||
# sonarcloud-check: | ||
# needs: build | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: SonarCloud Scan | ||
# uses: sonarsource/sonarcloud-github-action@master | ||
# with: | ||
# projectBaseDir: . | ||
# args: > | ||
# -Dsonar.projectKey=amczuboka_Decagon-CondoManagementSystem | ||
# -Dsonar.organization=decagon | ||
# -Dsonar.coverageReportPaths=coverage/lcov.info | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
cypress-run: | ||
needs: build | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Cypress run | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
build: npm run build | ||
start: npm start |