Skip to content

Update cypress_tests.yml #15

Update cypress_tests.yml

Update cypress_tests.yml #15

Workflow file for this run

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"

Check failure on line 29 in .github/workflows/cypress_tests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/cypress_tests.yml

Invalid workflow file

You have an error in your yaml syntax on line 29
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