Skip to content

Commit

Permalink
test on own file
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnickii committed Jun 5, 2024
1 parent 573440e commit bbec3b5
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 35 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/pr-reporting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
- name: Download coverage artifacts with cli
run: |
gh run download ${{ github.event.workflow_run.id }} -n coverage
- name: Display structure of downloaded files
run: ls -R
- name: Code Coverage Summary Report
uses: irongut/[email protected]
with:
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
name: Build pr

on:
push:
branches: [main]
pull_request:
branches: [main, release/**, next/**]

Expand All @@ -17,8 +15,6 @@ permissions:
jobs:
build:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}

strategy:
matrix:
Expand Down Expand Up @@ -51,12 +47,6 @@ jobs:
with:
name: coverage
path: coverage/cobertura-coverage.xml
- name: Archive coverage lcov.info
uses: actions/upload-artifact@v2 # upload coverage lcov.info
if: always() # run this step even if previous step failed
with:
name: coverage
path: coverage/lcov.info

- name: Code Coverage Summary Report
uses: irongut/[email protected]
Expand All @@ -82,26 +72,3 @@ jobs:
- name: One or more build matrix options failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1

# Configuration to run a SonarCloud analysis on main, release and next branches
sonarcloud:
name: SonarCloud Analysis
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/download-artifact@v4
- name: Display structure of downloaded files
run: ls -R

- name: Run sonar cloud analysis
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
67 changes: 67 additions & 0 deletions .github/workflows/sonarCloudAnalysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# Tests are executed and coverage reports are emitted as to the action summary
# A dependent workflow which uses workflow_run as a trigger reads the archived outputs and emits comments to the PR triggering this build

name: Sonar Cloud

on:
push:
branches: [main, chore/**, release/**, next/**]
paths:
- 'packages/**'
pull_request:
branches: [main, release/**, next/**, chore/**]
paths:
- 'packages/**'

permissions:
pull-requests: write

jobs:
sonarcloud:
name: SonarCloud Analysis
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}

strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install -g lerna
- name: Install node_modules
run: yarn
- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium
- run: node scripts/setVersion.js --next
- run: yarn build
- run: yarn lint
- run: yarn test
- name: Archive coverage lcov.info
uses: actions/upload-artifact@v2 # upload coverage lcov.info
if: always() # run this step even if previous step failed
with:
name: coverage
path: coverage/lcov.info

- uses: actions/download-artifact@v4
with:
name: coverage
path: coverage/lcov.info

- name: Display structure of downloaded files
run: ls -R

- name: Run sonar cloud analysis
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 comments on commit bbec3b5

Please sign in to comment.