Skip to content
Draft
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Monorepo: `npm workspaces` and `Nx`
## Jasmine Test Angular libs
### All library tests
See `ci-scripts/unit-tests.sh`
This is a test from Florent to analyse PR checks after modifying .md files.

### Specific tests
```bash
Expand Down
42 changes: 38 additions & 4 deletions .github/workflows/ci-continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
- develop-*
- release/*
- epic/**
paths-ignore:
- '**.md'
- 'docs/**'
workflow_dispatch:
# empty as it is used only to manually trigger the workflow

Expand All @@ -23,9 +20,41 @@ concurrency:

name: Continuous Integration
jobs:
detect_changes:
name: CI - Detect changes
runs-on: ubuntu-latest
outputs:
RUN_CI_CHECKS: ${{ steps.detect.outputs.RUN_CI_CHECKS }}
steps:
- name: Determine whether to run CI checks
id: detect
uses: actions/github-script@v7
with:
script: |
if (!context.payload.pull_request) {
core.setOutput('RUN_CI_CHECKS', 'true');
return;
}

const files = await github.paginate(github.rest.pulls.listFiles, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
per_page: 100,
});

const shouldRun = files.some((file) => {
const filename = file.filename;
return !filename.startsWith('docs/') && !filename.endsWith('.md');
});

core.setOutput('RUN_CI_CHECKS', shouldRun ? 'true' : 'false');

unit_tests:
needs: [detect_changes]
name: CI - Unit tests
runs-on: ubuntu-latest
if: ${{ needs.detect_changes.outputs.RUN_CI_CHECKS == 'true' }}
steps:
- uses: actions/checkout@v6
with:
Expand All @@ -50,6 +79,7 @@ jobs:
run: |
ci-scripts/unit-tests.sh
sonarqube_scan:
needs: [detect_changes]
name: CI - SonarQube Scan
runs-on: ubuntu-latest
steps:
Expand All @@ -66,10 +96,12 @@ jobs:
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: https://sonar.tools.sap
if: github.event_name == 'pull_request'
if: ${{ github.event_name == 'pull_request' && needs.detect_changes.outputs.RUN_CI_CHECKS == 'true' }}
linting:
needs: [detect_changes]
name: CI - Validations and static code checks
runs-on: ubuntu-latest
if: ${{ needs.detect_changes.outputs.RUN_CI_CHECKS == 'true' }}
steps:
- uses: actions/checkout@v6
- name: Setup node
Expand All @@ -92,8 +124,10 @@ jobs:
run: |
ci-scripts/validate-lint.sh
check_peer_dependencies:
needs: [detect_changes]
name: CI - Check peerDependencies
runs-on: ubuntu-latest
if: ${{ needs.detect_changes.outputs.RUN_CI_CHECKS == 'true' }}
steps:
- uses: actions/checkout@v6
with:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/ci-merge-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
- develop
- develop-*
- release/*
paths-ignore:
- '**.md'
- 'docs/**'

workflow_dispatch:
# empty as it is used only to manually trigger the workflow
Expand Down
36 changes: 30 additions & 6 deletions .github/workflows/config-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,51 @@ on:
pull_request:
types: [opened, synchronize, reopened]

paths-ignore:
- '**.md'
- 'docs/**'

name: Config check
jobs:
configCheck:
name: Dependencies and tsconfig files
runs-on: ubuntu-latest
steps:
- name: Detect whether config check should run
id: detect_changes
uses: actions/github-script@v7
with:
script: |
const files = await github.paginate(github.rest.pulls.listFiles, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
per_page: 100,
});

const shouldRun = files.some((file) => {
const filename = file.filename;
return !filename.startsWith('docs/') && !filename.endsWith('.md');
});

core.setOutput('run_config_check', shouldRun ? 'true' : 'false');

- name: Skip config check for docs-only changes
if: ${{ steps.detect_changes.outputs.run_config_check != 'true' }}
run: echo 'Skipping config check because PR changes only markdown/docs files.'

- name: Cancel Previous Runs
if: ${{ steps.detect_changes.outputs.run_config_check == 'true' }}
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@master
- uses: actions/setup-node@v4
- if: ${{ steps.detect_changes.outputs.run_config_check == 'true' }}
uses: actions/checkout@master
- if: ${{ steps.detect_changes.outputs.run_config_check == 'true' }}
uses: actions/setup-node@v4
with:
node-version: '20'
- name: NPM
if: ${{ steps.detect_changes.outputs.run_config_check == 'true' }}
run: npm i
- name: Check configurations
if: ${{ steps.detect_changes.outputs.run_config_check == 'true' }}
run: npm run config:check
env:
FORCE_COLOR: 2 # Support colors from chalk
Loading