Skip to content

Commit c448b2e

Browse files
committed
Merge branch 'master_it3D' into dev_demo-25-11-07
2 parents 6239740 + 53cd4cc commit c448b2e

File tree

455 files changed

+7220
-28696
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

455 files changed

+7220
-28696
lines changed

.github/workflows/build-and-test.yml

Lines changed: 482 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Nightly generate binaries
2+
3+
# ===============================================================
4+
# ===============================================================
5+
6+
7+
on:
8+
# Nightly build
9+
schedule:
10+
- cron: '0 2 * * *' # Evevery night
11+
12+
# ===============================================================
13+
# ===============================================================
14+
15+
16+
jobs:
17+
# Nightly build triggered once a day
18+
nightly_build:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
sofa_version: [master]
23+
if: ${{ github.repository_owner == 'sofa-framework' }}
24+
outputs:
25+
SOFA_BRANCH_NAME: ${{ steps.export-vars.outputs.SOFA_BRANCH_NAME }}
26+
SOFA_COMMIT_SHA: ${{ steps.export-vars.outputs.SOFA_COMMIT_SHA }}
27+
PRESET: ${{ steps.export-vars.outputs.PRESET }}
28+
PYTHON_VERSION: ${{ steps.export-vars.outputs.PYTHON_VERSION }}
29+
CI_DEPENDS_ON: ${{ steps.export-vars.outputs.CI_DEPENDS_ON }}
30+
WITH_ALL_TESTS: ${{ steps.export-vars.outputs.WITH_ALL_TESTS }}
31+
FORCE_FULL_BUILD: ${{ steps.export-vars.outputs.FORCE_FULL_BUILD }}
32+
EXTERNAL_PLUGINS: ${{ steps.export-vars.outputs.EXTERNAL_PLUGINS }}
33+
ADDITIONNAL_CMAKE_FLAGS: ${{ steps.export-vars.outputs.ADDITIONNAL_CMAKE_FLAGS }}
34+
GENERATE_BINARIES: ${{ steps.export-vars.outputs.GENERATE_BINARIES }}
35+
PR_OWNER_URL: ${{ steps.export-vars.outputs.PR_OWNER_URL }}
36+
PR_BRANCH_NAME: ${{ steps.export-vars.outputs.PR_BRANCH_NAME }}
37+
PR_COMMIT_SHA: ${{ steps.export-vars.outputs.PR_COMMIT_SHA }}
38+
BUILDER_OS: ${{ steps.export-vars.outputs.BUILDER_OS }}
39+
40+
steps:
41+
- name: Export outputs
42+
id: export-vars
43+
run: |
44+
echo "SOFA_BRANCH_NAME=${{ matrix.sofa_version }}" >> $GITHUB_OUTPUT # SOFA_BRANCH_NAME: "${{ matrix.sofa_version }}"
45+
echo "SOFA_COMMIT_SHA=HEAD" >> $GITHUB_OUTPUT # SOFA_COMMIT_SHA: "HEAD"
46+
echo "PRESET=standard" >> $GITHUB_OUTPUT # PRESET: "standard"
47+
echo "PYTHON_VERSION=3.12" >> $GITHUB_OUTPUT # PYTHON_VERSION: "3.12"
48+
echo "CI_DEPENDS_ON=" >> $GITHUB_OUTPUT # CI_DEPENDS_ON: ""
49+
echo "WITH_ALL_TESTS=false" >> $GITHUB_OUTPUT # WITH_ALL_TESTS: false
50+
echo "FORCE_FULL_BUILD=true" >> $GITHUB_OUTPUT # FORCE_FULL_BUILD: true
51+
echo "EXTERNAL_PLUGINS=" >> $GITHUB_OUTPUT # EXTERNAL_PLUGINS: ""
52+
echo "ADDITIONNAL_CMAKE_FLAGS=" >> $GITHUB_OUTPUT # ADDITIONNAL_CMAKE_FLAGS: ""
53+
echo "GENERATE_BINARIES=true" >> $GITHUB_OUTPUT # GENERATE_BINARIES: true
54+
echo "PR_OWNER_URL=" >> $GITHUB_OUTPUT # PR_OWNER_URL: ""
55+
echo "PR_BRANCH_NAME=" >> $GITHUB_OUTPUT # PR_BRANCH_NAME: ""
56+
echo "PR_COMMIT_SHA=HEAD" >> $GITHUB_OUTPUT # PR_COMMIT_SHA: "HEAD"
57+
echo 'BUILDER_OS=["sh-ubuntu_gcc_release","sh-macos_clang_release"]' >> $GITHUB_OUTPUT # BUILDER_OS: ["sh-ubuntu_gcc_release","sh-macos_clang_release"]
58+
59+
60+
# ===============================================================
61+
# ===============================================================
62+
63+
# Trigger the build and sharing all parameters from nightly_build > outputs
64+
build-on:
65+
needs: nightly_build
66+
if: ${{ github.repository_owner == 'sofa-framework' }}
67+
uses: sofa-framework/sofa/.github/workflows/build-and-test.yml@master
68+
with:
69+
sofa-branch-name: ${{ needs.nightly_build.outputs.SOFA_BRANCH_NAME }}
70+
sofa-commit-sha: ${{ needs.nightly_build.outputs.SOFA_COMMIT_SHA }}
71+
preset: ${{ needs.nightly_build.outputs.PRESET }}
72+
python-version: ${{ needs.nightly_build.outputs.PYTHON_VERSION }}
73+
ci-depends-on: ${{ needs.nightly_build.outputs.CI_DEPENDS_ON }}
74+
with-all-tests: ${{ needs.nightly_build.outputs.WITH_ALL_TESTS == 'true'}}
75+
force-full-build: ${{ needs.nightly_build.outputs.FORCE_FULL_BUILD == 'true'}}
76+
external-plugins: ${{ needs.nightly_build.outputs.EXTERNAL_PLUGINS }}
77+
additionnal-cmake-flags: ${{ needs.nightly_build.outputs.ADDITIONNAL_CMAKE_FLAGS }}
78+
generate-binaries: ${{ needs.nightly_build.outputs.GENERATE_BINARIES == 'true'}}
79+
pr-owner-url: ${{ needs.nightly_build.outputs.PR_OWNER_URL }}
80+
pr-branch-name: ${{ needs.nightly_build.outputs.PR_BRANCH_NAME }}
81+
pr-commit-sha: ${{ needs.nightly_build.outputs.PR_COMMIT_SHA }}
82+
builder-os: ${{ needs.nightly_build.outputs.BUILDER_OS }}

.github/workflows/pr-label-checker.yml

Lines changed: 78 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
name: PR check - Labels
32
on:
43
pull_request:
@@ -18,13 +17,73 @@ jobs:
1817
if: ${{ github.repository_owner == 'sofa-framework' }}
1918

2019
steps:
21-
- name: Delay for 10 Seconds
20+
21+
- name: Check status labels
22+
id: check_status_labels
23+
uses: actions/github-script@v7
24+
with:
25+
github-token: ${{ secrets.GITHUB_TOKEN }}
26+
script: |
27+
// Get PR info: id and labels
28+
const prNumber = context.payload.pull_request.number;
29+
const labels = context.payload.pull_request.labels.map(label => label.name);
30+
31+
// Array of possible labels defining the status of the PR
32+
const statusLabels = [
33+
'pr: status wip',
34+
'pr: status to review',
35+
'pr: status ready'
36+
];
37+
38+
// Filter the labels array to get only the status labels
39+
const matchingStatusLabels = labels.filter(label => statusLabels.includes(label));
40+
41+
// Count the number of entries in 'matchingLabels'
42+
const matchingLabelsCount = matchingStatusLabels.length;
43+
44+
// If no descriptive label is set, add a comment in the PR and make the action check fail
45+
if (matchingLabelsCount === 0) {
46+
const comment = ':information_source: @'+context.payload.pull_request.user.login+' your PR does not include any **status** label :label: The label \"pr: status to review\" is added automatically.';
47+
github.rest.issues.createComment({
48+
issue_number: prNumber,
49+
owner: context.repo.owner,
50+
repo: context.repo.repo,
51+
body: comment
52+
});
53+
54+
// Set flag to TRUE
55+
core.setOutput('no_status_label', 'true');
56+
}
57+
else if (matchingLabelsCount > 1) {
58+
const comment = ':warning: :warning: :warning:<br>@'+context.payload.pull_request.user.login+' your PR includes **too many status labels** :label:<br> Make sure to **select only one** (wip, to review or ready).<br>:warning: :warning: :warning:';
59+
github.rest.issues.createComment({
60+
issue_number: prNumber,
61+
owner: context.repo.owner,
62+
repo: context.repo.repo,
63+
body: comment
64+
});
65+
66+
// Make the action step fail
67+
core.setFailed('Too many status PR labels');
68+
}
69+
70+
// Print all PR labels in log
71+
console.log('Labels:', labels.join(', '));
72+
73+
- name: Add status label if none given
74+
if: ${{ steps.check_status_labels.outputs.no_status_label == 'true' }}
2275
run: |
23-
echo "Waiting for 10 seconds in case other labels get changed"
24-
sleep 10
25-
- name: Check Labels and Add Comment
26-
id: check_labels_and_comment
27-
uses: actions/github-script@v5
76+
gh pr edit "$NUMBER" --add-label "$LABELS"
77+
env:
78+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
GH_REPO: ${{ github.repository }}
80+
NUMBER: ${{ github.event.pull_request.number }}
81+
LABELS: "pr: status to review"
82+
83+
- name: Check descriptive labels
84+
if: ${{ always() }}
85+
id: check_descriptive_labels
86+
uses: actions/github-script@v7
2887
with:
2988
github-token: ${{ secrets.GITHUB_TOKEN }}
3089
script: |
@@ -58,42 +117,21 @@ jobs:
58117
repo: context.repo.repo,
59118
body: comment
60119
});
120+
121+
// Make the action step fail
61122
core.setFailed('Invalid PR label');
62123
}
63124
64-
// Array of possible labels defining the status of the PR
65-
const statusLabels = [
66-
'pr: status wip',
67-
'pr: status to review',
68-
'pr: status ready'
69-
];
70-
71-
// Filter the labels array to get only the status labels
72-
const matchingStatusLabels = labels.filter(label => statusLabels.includes(label));
73-
74-
// Count the number of entries in 'matchingLabels'
75-
const matchingLabelsCount = matchingStatusLabels.length;
125+
- name: Check label pr based on previous PR
126+
if: ${{ always() }}
127+
uses: actions/github-script@v7
128+
with:
129+
script: |
130+
const labels = context.payload.pull_request.labels.map(label => label.name);
131+
const found = labels.includes("pr: based on previous PR");
76132
77-
// If no descriptive label is set, add a comment in the PR and make the action check fail
78-
if (matchingLabelsCount === 0) {
79-
const comment = ':warning: :warning: :warning:<br>@'+context.repo.owner+' your PR does not include any **status** label :label:<br> Make sure to add one (wip, to review or ready).<br>:warning: :warning: :warning:';
80-
github.rest.issues.createComment({
81-
issue_number: prNumber,
82-
owner: context.repo.owner,
83-
repo: context.repo.repo,
84-
body: comment
85-
});
86-
core.setFailed('Missing status PR label')
87-
} else if (matchingLabelsCount > 1) {
88-
const comment = ':warning: :warning: :warning:<br>@'+context.repo.owner+' your PR does includes **too many status labels** :label:<br> Make sure to keep only one (wip, to review or ready).<br>:warning: :warning: :warning:';
89-
github.rest.issues.createComment({
90-
issue_number: prNumber,
91-
owner: context.repo.owner,
92-
repo: context.repo.repo,
93-
body: comment
94-
});
95-
core.setFailed('Too many status PR labels')
133+
// Make the action step fail
134+
if (found) {
135+
core.setFailed("Merge blocked: PR has label 'pr: based on previous PR'");
96136
}
97137
98-
// Add all PR labels in log
99-
console.log('Labels:', labels.join(', '));

.github/workflows/pr-timing-checker.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ on:
1111

1212
jobs:
1313

14-
check_labels:
15-
name: Check labels
14+
check_pr_age:
15+
name: Check PR age
1616
runs-on: ubuntu-latest
1717
if: ${{ github.repository_owner == 'sofa-framework' }}
1818

1919
steps:
20-
- name: Check Labels and Age
21-
id: check_labels_and_comment
20+
- name: Check Age and fast-merge Label
21+
id: check_age
2222
uses: actions/github-script@v5
2323
with:
2424
github-token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Reboot builders
2+
3+
# ===============================================================
4+
# ===============================================================
5+
6+
7+
on:
8+
# On-demand binary generation
9+
workflow_dispatch:
10+
inputs:
11+
builder-os:
12+
type: choice
13+
description: On which OS run the binaries generation
14+
options:
15+
- '["sofa-ci-dev-ubuntu2204-0"]'
16+
- '["sofa-ci-dev-ubuntu2204-1"]'
17+
- '["sofa-ci-dev-ubuntu2204-2"]'
18+
- '["sofa-ci-dev-ubuntu2204-3"]'
19+
- '["sofa-ci-dev-ubuntu2204-4"]'
20+
- '["consortium-macos-2-1"]'
21+
- '["consortium-macos-3-1"]'
22+
- '["sofa-ci-dev-ubuntu2204-0","sofa-ci-dev-ubuntu2204-1","sofa-ci-dev-ubuntu2204-2","sofa-ci-dev-ubuntu2204-3","sofa-ci-dev-ubuntu2204-4","consortium-macos-2-1","consortium-macos-3-1"]'
23+
default: '["sofa-ci-dev-ubuntu2204-0","sofa-ci-dev-ubuntu2204-1","sofa-ci-dev-ubuntu2204-2","sofa-ci-dev-ubuntu2204-3","sofa-ci-dev-ubuntu2204-4","consortium-macos-2-1","consortium-macos-3-1"]'
24+
25+
26+
27+
# Nightly build
28+
schedule:
29+
- cron: '30 1 * * *' # Evevery night @1:30 a.m.
30+
31+
# ===============================================================
32+
# ===============================================================
33+
34+
35+
jobs:
36+
# Filter build handling : push in master, commits in PR, comments in PR and dispatch
37+
reboot_builders_by_hand:
38+
if: ${{ github.event_name != 'schedule'}}
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
os: ${{ fromJson(inputs.builder-os) }}
43+
runs-on: ${{ matrix.os }}
44+
steps:
45+
- name: Clear ccache
46+
if: ${{ runner.os == 'Linux' }}
47+
shell: bash
48+
run: |
49+
if [[ -n "$BUILDER_CACHE_DIR" ]]; then
50+
rm -rf $BUILDER_CACHE_DIR/*
51+
fi
52+
53+
- name: Reboot builder
54+
shell: bash
55+
run: |
56+
# WARNING: this command needs to add in /etc/sudoers this line:
57+
# ALL ALL=NOPASSWD: /usr/sbin/reboot, /usr/sbin/shutdown, /sbin/reboot, /sbin/shutdown
58+
echo '' | sudo -S /sbin/shutdown -r +1 &
59+
60+
rebot_builder_nightly:
61+
if: ${{ github.event_name == 'schedule'}}
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
os: ["sofa-ci-dev-ubuntu2204-0","sofa-ci-dev-ubuntu2204-1","sofa-ci-dev-ubuntu2204-2","sofa-ci-dev-ubuntu2204-3","sofa-ci-dev-ubuntu2204-4","consortium-macos-2-1","consortium-macos-3-1"]
66+
runs-on: ${{ matrix.os }}
67+
steps:
68+
- name: Clear ccache
69+
if: ${{ runner.os == 'Linux' }}
70+
shell: bash
71+
run: |
72+
if [[ -n "$BUILDER_CACHE_DIR" ]]; then
73+
rm -rf $BUILDER_CACHE_DIR/*
74+
fi
75+
76+
- name: Reboot builder
77+
shell: bash
78+
run: |
79+
# WARNING: this command needs to add in /etc/sudoers this line:
80+
# ALL ALL=NOPASSWD: /usr/sbin/reboot, /usr/sbin/shutdown, /sbin/reboot, /sbin/shutdown
81+
echo '' | sudo -S /sbin/shutdown -r +1 &

0 commit comments

Comments
 (0)