Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/qa/FOO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Foo

Bar.
43 changes: 39 additions & 4 deletions .github/workflows/merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
script: |
const commit = context.sha;
const { owner, repo } = context.repo;

// Find the PR that was merged
const { data: prs } = await github.rest.pulls.list({
owner,
Expand All @@ -58,16 +58,16 @@ jobs:
direction: 'desc',
per_page: 100
});

const mergedPR = prs.find(pr => pr.merge_commit_sha === commit);

if (mergedPR) {
core.exportVariable('PR_NUMBER', mergedPR.number);
core.exportVariable('PR_TITLE', mergedPR.title);
core.exportVariable('GITHUB_EVENT_NAME', 'pull_request');
core.exportVariable('GITHUB_EVENT_ACTION', 'closed');
core.exportVariable('GITHUB_PULL_REQUEST_MERGED', 'true');

console.log(`Found PR #${mergedPR.number}: ${mergedPR.title}`);
} else {
console.log('No matching PR found for this commit');
Expand Down Expand Up @@ -105,3 +105,38 @@ jobs:
git add web-vitals-history.json
git commit -m "chore: update web vitals history [skip ci]" || echo "No changes to commit"
git push origin main || echo "No changes to push"
check-coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: Install
run: npm ci
- name: Coverage
run: npm run test:coverage
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/
sonarqube:
name: Run SonarQube Analysis
needs: check-coverage
runs-on: [self-hosted, macos-qa]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Download coverage report
uses: actions/download-artifact@v4
with:
name: coverage-report
path: coverage/
- uses: SonarSource/sonarqube-scan-action@v6
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
22 changes: 22 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,28 @@ jobs:
run: npm ci
- name: Coverage
run: npm run test:coverage
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/
sonarqube:
name: Run SonarQube Analysis
needs: check-coverage-thresholds
runs-on: [self-hosted, macos-qa]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Download coverage report
uses: actions/download-artifact@v4
with:
name: coverage-report
path: coverage/
- uses: SonarSource/sonarqube-scan-action@v6
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
deployment:
needs: check-build
environment:
Expand Down
4 changes: 4 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sonar.projectKey=adobecom_caas_9e89bc21-de4f-46e2-9443-2052ced9386d
sonar.sources=react
sonar.test.inclusions=**/__tests__/**,**/__test__/**
sonar.javascript.lcov.reportPaths=coverage/lcov.info
Loading