Replace GitHub Actions with Gitea Actions
- Remove all GitHub Actions workflows (21 files) - Remove GitHub problem matchers - Add Gitea build workflow (push/PR to main) - Add Gitea release workflow (version tags) - Use pixi for dependency management - Configure ccache for build acceleration - Use 16 build threads for debian-host runner - Update .gitignore to allow .gitea/ directory
This commit is contained in:
70
.gitea/workflows/build.yml
Normal file
70
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
|
name: Build and Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: debian-host
|
||||||
|
|
||||||
|
env:
|
||||||
|
CCACHE_DIR: /var/cache/ccache/kindred-create
|
||||||
|
CCACHE_COMPRESS: "true"
|
||||||
|
CCACHE_COMPRESSLEVEL: "5"
|
||||||
|
CCACHE_MAXSIZE: "2G"
|
||||||
|
CCACHE_NODIRECT: "true"
|
||||||
|
CCACHE_NOHASHDIR: "true"
|
||||||
|
CCACHE_NOINODECACHE: "true"
|
||||||
|
CCACHE_SLOPPINESS: "include_file_ctime,include_file_mtime,pch_defines,time_macros"
|
||||||
|
CCACHE_COMPILERCHECK: "%compiler% -dumpfullversion -dumpversion"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: https://github.com/actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install pixi if needed
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if ! command -v pixi &> /dev/null; then
|
||||||
|
curl -fsSL https://pixi.sh/install.sh | bash
|
||||||
|
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
|
||||||
|
export PATH="$HOME/.pixi/bin:$PATH"
|
||||||
|
fi
|
||||||
|
pixi --version
|
||||||
|
|
||||||
|
- name: Prepare ccache
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo mkdir -p $CCACHE_DIR
|
||||||
|
sudo chown $(whoami):$(whoami) $CCACHE_DIR
|
||||||
|
pixi run ccache -z
|
||||||
|
pixi run ccache -p
|
||||||
|
|
||||||
|
- name: Configure (CMake)
|
||||||
|
run: pixi run configure-release
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: pixi run cmake --build build/release -j16
|
||||||
|
|
||||||
|
- name: Show ccache statistics
|
||||||
|
run: pixi run ccache -s
|
||||||
|
|
||||||
|
- name: Run C++ unit tests
|
||||||
|
run: pixi run test-release
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
run: pixi run install-release
|
||||||
|
|
||||||
|
- name: Run Python CLI tests
|
||||||
|
run: pixi run build/release/bin/FreeCADCmd -t 0 || true
|
||||||
|
|
||||||
|
- name: Run GUI tests (headless)
|
||||||
|
run: pixi run xvfb-run build/release/bin/FreeCAD -t 0 || true
|
||||||
76
.gitea/workflows/release.yml
Normal file
76
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
|
name: Release Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: ['v*', 'weekly-*']
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: 'Release tag (e.g., v1.0.0)'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-linux-appimage:
|
||||||
|
runs-on: debian-host
|
||||||
|
|
||||||
|
env:
|
||||||
|
CCACHE_DIR: /var/cache/ccache/kindred-create
|
||||||
|
CCACHE_COMPRESS: "true"
|
||||||
|
CCACHE_COMPRESSLEVEL: "5"
|
||||||
|
CCACHE_MAXSIZE: "2G"
|
||||||
|
CCACHE_NODIRECT: "true"
|
||||||
|
CCACHE_NOHASHDIR: "true"
|
||||||
|
CCACHE_NOINODECACHE: "true"
|
||||||
|
CCACHE_SLOPPINESS: "include_file_ctime,include_file_mtime,pch_defines,time_macros"
|
||||||
|
CCACHE_COMPILERCHECK: "%compiler% -dumpfullversion -dumpversion"
|
||||||
|
BUILD_TAG: ${{ github.ref_name || inputs.tag }}
|
||||||
|
MAKE_INSTALLER: "true"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: https://github.com/actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
fetch-depth: 0
|
||||||
|
fetch-tags: true
|
||||||
|
|
||||||
|
- name: Install pixi if needed
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if ! command -v pixi &> /dev/null; then
|
||||||
|
curl -fsSL https://pixi.sh/install.sh | bash
|
||||||
|
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
|
||||||
|
export PATH="$HOME/.pixi/bin:$PATH"
|
||||||
|
fi
|
||||||
|
pixi --version
|
||||||
|
|
||||||
|
- name: Prepare ccache
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo mkdir -p $CCACHE_DIR
|
||||||
|
sudo chown $(whoami):$(whoami) $CCACHE_DIR
|
||||||
|
pixi run ccache -z
|
||||||
|
|
||||||
|
- name: Write version info
|
||||||
|
run: python3 package/scripts/write_version_info.py ../freecad_version.txt
|
||||||
|
|
||||||
|
- name: Build release package (AppImage)
|
||||||
|
working-directory: package/rattler-build
|
||||||
|
run: |
|
||||||
|
pixi install
|
||||||
|
pixi run -e package create_bundle
|
||||||
|
|
||||||
|
- name: Show ccache statistics
|
||||||
|
run: pixi run ccache -s
|
||||||
|
|
||||||
|
- name: Upload AppImage artifact
|
||||||
|
uses: https://github.com/actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: kindred-create-linux-x86_64-${{ env.BUILD_TAG }}
|
||||||
|
path: |
|
||||||
|
package/rattler-build/linux/*.AppImage
|
||||||
|
package/rattler-build/linux/*.AppImage.zsync
|
||||||
|
package/rattler-build/linux/*-SHA256.txt
|
||||||
|
if-no-files-found: warn
|
||||||
15
.github/problemMatcher/blackWarning.json
vendored
15
.github/problemMatcher/blackWarning.json
vendored
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"problemMatcher": [
|
|
||||||
{
|
|
||||||
"owner": "black-warning",
|
|
||||||
"severity": "warning",
|
|
||||||
"pattern": [
|
|
||||||
{
|
|
||||||
"regexp": "^(would reformat (.*))$",
|
|
||||||
"file": 2,
|
|
||||||
"message": 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
17
.github/problemMatcher/clang.json
vendored
17
.github/problemMatcher/clang.json
vendored
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"problemMatcher": [
|
|
||||||
{
|
|
||||||
"owner": "clang",
|
|
||||||
"pattern": [
|
|
||||||
{
|
|
||||||
"regexp": "^(.+):([0-9]+):([0-9]+): (error|warning|note): (.+)$",
|
|
||||||
"file": 1,
|
|
||||||
"line": 2,
|
|
||||||
"column": 3,
|
|
||||||
"severity": 4,
|
|
||||||
"message": 5
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
16
.github/problemMatcher/codespell.json
vendored
16
.github/problemMatcher/codespell.json
vendored
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"problemMatcher": [
|
|
||||||
{
|
|
||||||
"owner": "codespell-matcher",
|
|
||||||
"severity": "warning",
|
|
||||||
"pattern": [
|
|
||||||
{
|
|
||||||
"regexp": "^(.+):(\\d+):\\s+(.+)$",
|
|
||||||
"file": 1,
|
|
||||||
"line": 2,
|
|
||||||
"message": 3
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
16
.github/problemMatcher/cpplint.json
vendored
16
.github/problemMatcher/cpplint.json
vendored
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"problemMatcher": [
|
|
||||||
{
|
|
||||||
"owner": "cpplint",
|
|
||||||
"severity": "warning",
|
|
||||||
"pattern": [
|
|
||||||
{
|
|
||||||
"regexp": "^(.+):([0-9]+): (.+)$",
|
|
||||||
"file": 1,
|
|
||||||
"line": 2,
|
|
||||||
"message": 3
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
18
.github/problemMatcher/gcc.json
vendored
18
.github/problemMatcher/gcc.json
vendored
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"__comment": "Taken from vscode-cpptools's Extension/package.json gcc rule",
|
|
||||||
"problemMatcher": [
|
|
||||||
{
|
|
||||||
"owner": "gcc-problem-matcher",
|
|
||||||
"pattern": [
|
|
||||||
{
|
|
||||||
"regexp": "^(.*):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
|
|
||||||
"file": 1,
|
|
||||||
"line": 2,
|
|
||||||
"column": 3,
|
|
||||||
"severity": 4,
|
|
||||||
"message": 5
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
16
.github/problemMatcher/grepMatcherWarning.json
vendored
16
.github/problemMatcher/grepMatcherWarning.json
vendored
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"problemMatcher": [
|
|
||||||
{
|
|
||||||
"owner": "grepMatcher-warning",
|
|
||||||
"severity": "warning",
|
|
||||||
"pattern": [
|
|
||||||
{
|
|
||||||
"regexp": "^(.+):([0-9]+):(.+)$",
|
|
||||||
"file": 1,
|
|
||||||
"line": 2,
|
|
||||||
"message": 3
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
20
.github/problemMatcher/msvc.json
vendored
20
.github/problemMatcher/msvc.json
vendored
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"__comment":
|
|
||||||
"Taken from vscode's vs/workbench/contrib/tasks/common/problemMatcher.ts msCompile rule",
|
|
||||||
"problemMatcher": [
|
|
||||||
{
|
|
||||||
"owner": "msvc-problem-matcher",
|
|
||||||
"pattern": [
|
|
||||||
{
|
|
||||||
"regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
|
|
||||||
"file": 1,
|
|
||||||
"line": 2,
|
|
||||||
"column": 3,
|
|
||||||
"severity": 4,
|
|
||||||
"code": 5,
|
|
||||||
"message": 6
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
18
.github/problemMatcher/pylintError.json
vendored
18
.github/problemMatcher/pylintError.json
vendored
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"problemMatcher": [
|
|
||||||
{
|
|
||||||
"owner": "pylint-error",
|
|
||||||
"severity": "error",
|
|
||||||
"pattern": [
|
|
||||||
{
|
|
||||||
"regexp": "^(.+?):([0-9]+):([0-9]+): ([([E|F][0-9]+): (.*)$",
|
|
||||||
"file": 1,
|
|
||||||
"line": 2,
|
|
||||||
"column": 3,
|
|
||||||
"code": 4,
|
|
||||||
"message": 5
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
18
.github/problemMatcher/pylintWarning.json
vendored
18
.github/problemMatcher/pylintWarning.json
vendored
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"problemMatcher": [
|
|
||||||
{
|
|
||||||
"owner": "pylint-warning",
|
|
||||||
"severity": "warning",
|
|
||||||
"pattern": [
|
|
||||||
{
|
|
||||||
"regexp": "^(.+?):([0-9]+):([0-9]+): ([^E|F][0-9]+): (.*)$",
|
|
||||||
"file": 1,
|
|
||||||
"line": 2,
|
|
||||||
"column": 3,
|
|
||||||
"code": 4,
|
|
||||||
"message": 5
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
115
.github/workflows/CI_cleanup.yml
vendored
115
.github/workflows/CI_cleanup.yml
vendored
@@ -1,115 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
# This workflow is a complementary one to the master CI.
|
|
||||||
# It aims at doing cleanup operations after a CI workflow ran.
|
|
||||||
# Being triggered when the master workflow ends allows it to run with necessary privileges.
|
|
||||||
# Indeed it always run with push-like rights even for PR events.
|
|
||||||
|
|
||||||
# In order to work, this cleanup workflow imposes name formatting for caches
|
|
||||||
# Caches that have to be cleaned (typically compiler caches) shall be named as below :
|
|
||||||
# ${MARK}-${CONTEXT}-${REF}-${ID}
|
|
||||||
# with :
|
|
||||||
# ${MARK} => A mark identifying a cache to be cleaned, defined as being "FC" (without quotes)
|
|
||||||
# ${CONTEXT} => A string identifying cache saving context, typically OS name or compiler name
|
|
||||||
# ${REF} => The full reference of the branch owning the cache (starting with "/refs/pull/" or "/refs/heads/")
|
|
||||||
# ${ID} => A cache unique identifier, generally an ascending number, in no case containing a '-' (hyphen) sign
|
|
||||||
|
|
||||||
name: FreeCAD CI cleaner
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_run:
|
|
||||||
workflows: [FreeCAD master CI]
|
|
||||||
types:
|
|
||||||
- completed
|
|
||||||
|
|
||||||
env:
|
|
||||||
dryrun: false
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: FC-CI-cleaner
|
|
||||||
cancel-in-progress: false
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
CachesCleanup:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
logdir: /tmp/log/
|
|
||||||
steps:
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
- name: Make needed directories
|
|
||||||
run: |
|
|
||||||
mkdir -p ${{ env.logdir }}
|
|
||||||
- name: Get existing caches for the repo
|
|
||||||
run: |
|
|
||||||
curl -H "Accept: application/vnd.github+json" -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/caches > ${{ env.logdir }}caches.json
|
|
||||||
- name: Extract pull request caches
|
|
||||||
run: |
|
|
||||||
# Extract caches of which names starts with MARK and contains "/refs/pull/"
|
|
||||||
jq ".actions_caches | map(select(.key | startswith(\"FC-\"))) | map(select(.key | contains(\"refs/pull/\")))" ${{ env.logdir }}caches.json > ${{ env.logdir }}pulls.json
|
|
||||||
- name: Extract and delete pull request obsolete cache IDs
|
|
||||||
run: |
|
|
||||||
# Group the caches by MARK-CONTEXT-REF, sort by ascending last access datetime and keep all but the last as to be deleted
|
|
||||||
# As a consequence, for pull requests, only the most recent cache is kept (one for each context and for each PR)
|
|
||||||
PRID=$(jq "group_by(.key | .[:rindex(\"-\")]) | .[] | sort_by(.last_accessed_at) | .[:-1][].id" ${{ env.logdir }}pulls.json)
|
|
||||||
for id in $PRID
|
|
||||||
do
|
|
||||||
echo "Trying to delete pull request obsolete cache ID : $id"
|
|
||||||
if [ ${{ env.dryrun }} == "false" ]
|
|
||||||
then
|
|
||||||
curl -X DELETE -H "Accept: application/vnd.github+json" -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/caches/$id
|
|
||||||
else
|
|
||||||
echo "DRYRUN: executing : curl -X DELETE -H \"Accept: application/vnd.github+json\" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/caches/$id"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
- name: Extract push caches
|
|
||||||
run: |
|
|
||||||
# Extract caches of which names starts with MARK and contains "/refs/heads/"
|
|
||||||
jq ".actions_caches | map(select(.key | startswith(\"FC-\"))) | map(select(.key | contains(\"refs/heads/\")))" ${{ env.logdir }}caches.json > ${{ env.logdir }}pushes.json
|
|
||||||
- name: Extract and delete push obsolete cache IDs
|
|
||||||
run: |
|
|
||||||
# Group the caches by MARK-CONTEXT-REF, sort by ascending last access datetime, keep all but the last 2 and keep all accessed for more than 1 hour as to be deleted
|
|
||||||
# As a consequence, for pushes (repo branches), at least 2 caches (for each context and for each branch) are kept, others are deleted if they have been useless for more than 1 hour
|
|
||||||
PSID=$(jq "group_by(.key | .[:rindex(\"-\")]) | .[] | sort_by(.last_accessed_at) | .[:-2][] | select((.last_accessed_at | if contains(\".\") then .[:rindex(\".\")]+\"Z\" else . end | fromdateiso8601) < (now | floor - 3600)) | .id" ${{ env.logdir }}pushes.json)
|
|
||||||
for id in $PSID
|
|
||||||
do
|
|
||||||
echo "Trying to delete push obsolete cache ID : $id"
|
|
||||||
if [ ${{ env.dryrun }} == "false" ]
|
|
||||||
then
|
|
||||||
curl -X DELETE -H "Accept: application/vnd.github+json" -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/caches/$id
|
|
||||||
else
|
|
||||||
echo "DRYRUN: executing : curl -X DELETE -H \"Accept: application/vnd.github+json\" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/caches/$id"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
- name: Upload logs
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
||||||
with:
|
|
||||||
name: ${{ github.job }}-Logs
|
|
||||||
path: |
|
|
||||||
${{ env.logdir }}
|
|
||||||
93
.github/workflows/CI_master.yml
vendored
93
.github/workflows/CI_master.yml
vendored
@@ -1,93 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
# This is the master workflow for CI of FreeCAD.
|
|
||||||
# It (only) aims at properly organizing the sub-workflows.
|
|
||||||
|
|
||||||
name: FreeCAD master CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch: ~
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/**
|
|
||||||
pull_request: ~
|
|
||||||
merge_group: ~
|
|
||||||
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: FC-CI-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
Prepare:
|
|
||||||
uses: ./.github/workflows/sub_prepare.yml
|
|
||||||
with:
|
|
||||||
artifactBasename: Prepare-${{ github.run_id }}
|
|
||||||
|
|
||||||
Pixi:
|
|
||||||
needs: [Prepare]
|
|
||||||
uses: ./.github/workflows/sub_buildPixi.yml
|
|
||||||
with:
|
|
||||||
artifactBasename: Pixi-${{ github.run_id }}
|
|
||||||
|
|
||||||
Ubuntu:
|
|
||||||
needs: [Prepare]
|
|
||||||
if: "!startsWith(github.head_ref, 'refs/heads/backport-')"
|
|
||||||
uses: ./.github/workflows/sub_buildUbuntu.yml
|
|
||||||
with:
|
|
||||||
artifactBasename: Ubuntu-${{ github.run_id }}
|
|
||||||
|
|
||||||
Windows:
|
|
||||||
needs: [Prepare]
|
|
||||||
if: "!startsWith(github.head_ref, 'refs/heads/backport-')"
|
|
||||||
uses: ./.github/workflows/sub_buildWindows.yml
|
|
||||||
with:
|
|
||||||
artifactBasename: Windows-${{ github.run_id }}
|
|
||||||
|
|
||||||
Lint:
|
|
||||||
needs: [Prepare]
|
|
||||||
if: "!startsWith(github.head_ref, 'refs/heads/backport-')"
|
|
||||||
uses: ./.github/workflows/sub_lint.yml
|
|
||||||
with:
|
|
||||||
artifactBasename: Lint-${{ github.run_id }}
|
|
||||||
changedFiles: ${{ needs.Prepare.outputs.changedFiles }}
|
|
||||||
changedLines: ${{ needs.Prepare.outputs.changedLines }}
|
|
||||||
changedCppFiles: ${{ needs.Prepare.outputs.changedCppFiles }}
|
|
||||||
changedCppLines: ${{ needs.Prepare.outputs.changedCppLines }}
|
|
||||||
changedPythonFiles: ${{ needs.Prepare.outputs.changedPythonFiles }}
|
|
||||||
changedPythonLines: ${{ needs.Prepare.outputs.changedPythonLines }}
|
|
||||||
|
|
||||||
WrapUp:
|
|
||||||
needs: [
|
|
||||||
Prepare,
|
|
||||||
Pixi,
|
|
||||||
Ubuntu,
|
|
||||||
Windows,
|
|
||||||
Lint
|
|
||||||
]
|
|
||||||
if: always()
|
|
||||||
uses: ./.github/workflows/sub_wrapup.yml
|
|
||||||
with:
|
|
||||||
previousSteps: ${{ toJSON(needs) }}
|
|
||||||
74
.github/workflows/actions/linux/build/action.yml
vendored
74
.github/workflows/actions/linux/build/action.yml
vendored
@@ -1,74 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
name: build
|
|
||||||
description: "Linux: build application"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
builddir:
|
|
||||||
description: "Directory where build will happen"
|
|
||||||
required: true
|
|
||||||
logFile:
|
|
||||||
description: "Path for log file"
|
|
||||||
required: true
|
|
||||||
errorFile:
|
|
||||||
description: "Path to error file"
|
|
||||||
required: true
|
|
||||||
reportFile:
|
|
||||||
description: "Path for report file"
|
|
||||||
required: true
|
|
||||||
extraParameters:
|
|
||||||
description: "Extra parameters to CMake build"
|
|
||||||
required: false
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Build
|
|
||||||
id: build
|
|
||||||
shell: bash -l {0}
|
|
||||||
run: |
|
|
||||||
set -o pipefail
|
|
||||||
(stdbuf -oL -eL cmake --build ${{ inputs.builddir }} -j$(nproc) ${{ inputs.extraParameters }}) \
|
|
||||||
2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }}
|
|
||||||
- name: Write report
|
|
||||||
shell: bash -l {0}
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
if [ ${{ steps.build.outcome }} == 'success' ]
|
|
||||||
then
|
|
||||||
echo "<details><summary>:heavy_check_mark: CMake build succeeded</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
else
|
|
||||||
echo "<details><summary>:fire: CMake build failed</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
fi
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
echo "Build Error Log (stderr output):" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
echo "Build Log (only built targets reported):" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
cat ${{ inputs.logFile }} | sed -ne "/Built target/p" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
echo "</details>">> ${{ inputs.reportFile }}
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
name: configure
|
|
||||||
description: "Linux: configure CMake"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
sourcedir:
|
|
||||||
description: "Directory where sources are stored"
|
|
||||||
required: false
|
|
||||||
default: ./
|
|
||||||
builddir:
|
|
||||||
description: "Directory where build will happen"
|
|
||||||
required: true
|
|
||||||
logFile:
|
|
||||||
description: "Path for log file"
|
|
||||||
required: true
|
|
||||||
errorFile:
|
|
||||||
description: "Path to error file"
|
|
||||||
required: true
|
|
||||||
reportFile:
|
|
||||||
description: "Path for report file"
|
|
||||||
required: true
|
|
||||||
extraParameters:
|
|
||||||
description: "Extra parameters to CMake configure"
|
|
||||||
required: false
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Configure CMake
|
|
||||||
id: configure
|
|
||||||
shell: bash -l {0}
|
|
||||||
run: |
|
|
||||||
set -o pipefail
|
|
||||||
(stdbuf -oL -eL cmake -S ${{ inputs.sourcedir }} -B ${{ inputs.builddir }} -D CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE ${{inputs.extraParameters }}) \
|
|
||||||
2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }}
|
|
||||||
- name: Write report
|
|
||||||
shell: bash -l {0}
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
if [ ${{ steps.configure.outcome }} == 'success' ]
|
|
||||||
then
|
|
||||||
echo "<details><summary>:heavy_check_mark: CMake configure succeeded</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
echo "Configure Error Log (stderr output):" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
else
|
|
||||||
echo "<details><summary>:fire: CMake configure failed</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
fi
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
echo "Configure Log (only final configuration values reported):" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
cat ${{ inputs.logFile }} | sed -ne "/^ *==/,/^====/p" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
echo "</details>">> ${{ inputs.reportFile }}
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
name: generateCacheKey
|
|
||||||
description: "Linux: generates a cache key taking into account distro and compiler"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
compiler:
|
|
||||||
description: "Binary name/path of compiler to be used"
|
|
||||||
required: true
|
|
||||||
qt_major_version:
|
|
||||||
description: "Major version number of qt to be used"
|
|
||||||
required: true
|
|
||||||
outputs:
|
|
||||||
cacheKey:
|
|
||||||
description: "Cache key with distro and compiler version"
|
|
||||||
value: ${{ steps.generateCacheKey.outputs.cacheKey }}
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- id: generateCacheKey
|
|
||||||
shell: bash -l {0}
|
|
||||||
run: |
|
|
||||||
cacheKey=$(lsb_release -ds | tr -d ' ')-$(basename ${{ inputs.compiler }})$(${{ inputs.compiler }} -dumpfullversion -dumpversion)-qt${{ inputs.qt_major_version }}
|
|
||||||
echo "Generated cache key : $cacheKey"
|
|
||||||
echo "cacheKey=$cacheKey" >> $GITHUB_OUTPUT
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
name: install
|
|
||||||
description: "Linux: install application"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
builddir:
|
|
||||||
description: "Directory where build is stored"
|
|
||||||
required: true
|
|
||||||
logFile:
|
|
||||||
description: "Path for log file"
|
|
||||||
required: true
|
|
||||||
errorFile:
|
|
||||||
description: "Path to error file"
|
|
||||||
required: true
|
|
||||||
reportFile:
|
|
||||||
description: "Path for report file"
|
|
||||||
required: true
|
|
||||||
extraParameters:
|
|
||||||
description: "Extra parameters to CMake install"
|
|
||||||
required: false
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Install
|
|
||||||
id: install
|
|
||||||
shell: bash -l {0}
|
|
||||||
run: |
|
|
||||||
set -o pipefail
|
|
||||||
(stdbuf -oL -eL sudo cmake --install ${{ inputs.builddir }} ${{ inputs.extraParameters }}) \
|
|
||||||
2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }}
|
|
||||||
- name: Write report
|
|
||||||
shell: bash -l {0}
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
if [ ${{ steps.install.outcome }} == 'success' ]
|
|
||||||
then
|
|
||||||
echo "<details><summary>:heavy_check_mark: CMake install succeeded</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
else
|
|
||||||
echo "<details><summary>:fire: CMake install failed</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
fi
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
echo "Install Error Log (stderr output):" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
echo "Install Error Log (stdout output trimmed to the last 100 Lines):" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
tail -n 100 ${{ inputs.logFile }} >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
echo "</details>">> ${{ inputs.reportFile }}
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
73
.github/workflows/actions/macos/build/action.yml
vendored
73
.github/workflows/actions/macos/build/action.yml
vendored
@@ -1,73 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
name: build
|
|
||||||
description: "macOS: build application"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
builddir:
|
|
||||||
description: "Directory where build will happen"
|
|
||||||
required: true
|
|
||||||
logFile:
|
|
||||||
description: "Path for log file"
|
|
||||||
required: true
|
|
||||||
errorFile:
|
|
||||||
description: "Path to error file"
|
|
||||||
required: true
|
|
||||||
reportFile:
|
|
||||||
description: "Path for report file"
|
|
||||||
required: true
|
|
||||||
extraParameters:
|
|
||||||
description: "Extra parameters to CMake build"
|
|
||||||
required: false
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Build
|
|
||||||
id: build
|
|
||||||
shell: bash -l {0}
|
|
||||||
run: |
|
|
||||||
(cmake --build ${{ inputs.builddir }} -j$(nproc) ${{ inputs.extraParameters }}) \
|
|
||||||
2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }}
|
|
||||||
- name: Write report
|
|
||||||
shell: bash -l {0}
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
if [ ${{ steps.build.outcome }} == 'success' ]
|
|
||||||
then
|
|
||||||
echo "<details><summary>:heavy_check_mark: CMake build succeeded</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
else
|
|
||||||
echo "<details><summary>:fire: CMake build failed</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
fi
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
echo "Build Error Log (stderr output):" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
echo "Build Log (only built targets reported):" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
cat ${{ inputs.logFile }} | sed -ne "/Built target/p" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
echo "</details>">> ${{ inputs.reportFile }}
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
name: configure
|
|
||||||
description: "macOS: configure CMake"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
sourcedir:
|
|
||||||
description: "Directory where sources are stored"
|
|
||||||
required: false
|
|
||||||
default: ./
|
|
||||||
builddir:
|
|
||||||
description: "Directory where build will happen"
|
|
||||||
required: true
|
|
||||||
logFile:
|
|
||||||
description: "Path for log file"
|
|
||||||
required: true
|
|
||||||
errorFile:
|
|
||||||
description: "Path to error file"
|
|
||||||
required: true
|
|
||||||
reportFile:
|
|
||||||
description: "Path for report file"
|
|
||||||
required: true
|
|
||||||
extraParameters:
|
|
||||||
description: "Extra parameters to CMake configure"
|
|
||||||
required: false
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Configure CMake
|
|
||||||
id: configure
|
|
||||||
shell: bash -l {0}
|
|
||||||
run: |
|
|
||||||
(cmake -S ${{ inputs.sourcedir }} -B ${{ inputs.builddir }} -D CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE ${{inputs.extraParameters }}) \
|
|
||||||
2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }}
|
|
||||||
- name: Write report
|
|
||||||
shell: bash -l {0}
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
if [ ${{ steps.configure.outcome }} == 'success' ]
|
|
||||||
then
|
|
||||||
echo "<details><summary>:heavy_check_mark: CMake configure succeeded</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
echo "Configure Error Log (stderr output):" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
else
|
|
||||||
echo "<details><summary>:fire: CMake configure failed</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
fi
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
echo "Configure Log (only final configuration values reported):" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
cat ${{ inputs.logFile }} | sed -ne "/^ *==/,/^====/p" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
echo "</details>">> ${{ inputs.reportFile }}
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
name: generateCacheKey
|
|
||||||
description: "macOS: generates a cache key taking into account distro and compiler"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
compiler:
|
|
||||||
description: "Binary name/path of compiler to be used"
|
|
||||||
required: true
|
|
||||||
outputs:
|
|
||||||
cacheKey:
|
|
||||||
description: "Cache key with distro and compiler version"
|
|
||||||
value: ${{ steps.generateCacheKey.outputs.cacheKey }}
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- id: generateCacheKey
|
|
||||||
shell: bash -l {0}
|
|
||||||
run: |
|
|
||||||
cacheKey=$(sw_vers --productName)-$(sw_vers --productVersion)-$(basename ${{ inputs.compiler }})$(${{ inputs.compiler }} -dumpfullversion -dumpversion)
|
|
||||||
echo "Generated cache key : $cacheKey"
|
|
||||||
echo "cacheKey=$cacheKey" >> $GITHUB_OUTPUT
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
name: install
|
|
||||||
description: "macOS: install application"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
builddir:
|
|
||||||
description: "Directory where build is stored"
|
|
||||||
required: true
|
|
||||||
logFile:
|
|
||||||
description: "Path for log file"
|
|
||||||
required: true
|
|
||||||
errorFile:
|
|
||||||
description: "Path to error file"
|
|
||||||
required: true
|
|
||||||
reportFile:
|
|
||||||
description: "Path for report file"
|
|
||||||
required: true
|
|
||||||
extraParameters:
|
|
||||||
description: "Extra parameters to CMake install"
|
|
||||||
required: false
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Install
|
|
||||||
id: install
|
|
||||||
shell: bash -l {0}
|
|
||||||
run: |
|
|
||||||
(sudo cmake --install ${{ inputs.builddir }} ${{ inputs.extraParameters }}) \
|
|
||||||
2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }}
|
|
||||||
- name: Write report
|
|
||||||
shell: bash -l {0}
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
if [ ${{ steps.install.outcome }} == 'success' ]
|
|
||||||
then
|
|
||||||
echo "<details><summary>:heavy_check_mark: CMake install succeeded</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
else
|
|
||||||
echo "<details><summary>:fire: CMake install failed</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
fi
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
echo "Install Error Log (stderr output):" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
echo "Install Error Log (stdout output trimmed to the last 100 Lines):" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
tail -n 100 ${{ inputs.logFile }} >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
echo "</details>">> ${{ inputs.reportFile }}
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
@@ -1,169 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 The FreeCAD Project Association *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
# !!! Each step running a single test shall have an'id' defined so its report will be output
|
|
||||||
|
|
||||||
name: Run all C++ Tests
|
|
||||||
description: "Run all C++ tests, generating logs and reports for each"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
reportdir:
|
|
||||||
description: "Report directory where logs will be stored"
|
|
||||||
required: true
|
|
||||||
builddir:
|
|
||||||
description: "Build directory where tests are located"
|
|
||||||
required: true
|
|
||||||
reportFile:
|
|
||||||
description: "Path for report file"
|
|
||||||
required: true
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: C++ Assembly tests
|
|
||||||
id: assembly
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
|
||||||
with:
|
|
||||||
testCommand: ${{ inputs.builddir }}/tests/Assembly_tests_run --gtest_output=json:${{ inputs.reportdir }}assembly_gtest_results.json
|
|
||||||
testLogFile: ${{ inputs.reportdir }}assembly_gtest_test_log.txt
|
|
||||||
testName: Assembly
|
|
||||||
- name: C++ app tests
|
|
||||||
id: app
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
|
||||||
with:
|
|
||||||
testCommand: ${{ inputs.builddir }}/tests/App_tests_run --gtest_output=json:${{ inputs.reportdir }}app_gtest_results.json
|
|
||||||
testLogFile: ${{ inputs.reportdir }}app_gtest_test_log.txt
|
|
||||||
testName: App
|
|
||||||
- name: C++ base tests
|
|
||||||
id: base
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
|
||||||
with:
|
|
||||||
testCommand: ${{ inputs.builddir }}/tests/Base_tests_run --gtest_output=json:${{ inputs.reportdir }}base_gtest_results.json
|
|
||||||
testLogFile: ${{ inputs.reportdir }}base_gtest_test_log.txt
|
|
||||||
testName: Base
|
|
||||||
- name: C++ Gui tests
|
|
||||||
id: gui
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
|
||||||
with:
|
|
||||||
testCommand: ${{ inputs.builddir }}/tests/Gui_tests_run --gtest_output=json:${{ inputs.reportdir }}gui_gtest_results.json
|
|
||||||
testLogFile: ${{ inputs.reportdir }}gui_gtest_test_log.txt
|
|
||||||
testName: Gui
|
|
||||||
- name: C++ Material tests
|
|
||||||
id: material
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
|
||||||
with:
|
|
||||||
testCommand: ${{ inputs.builddir }}/tests/Material_tests_run --gtest_output=json:${{ inputs.reportdir }}material_gtest_results.json
|
|
||||||
testLogFile: ${{ inputs.reportdir }}material_gtest_test_log.txt
|
|
||||||
testName: Material
|
|
||||||
- name: C++ Measure tests
|
|
||||||
id: measure
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
|
||||||
with:
|
|
||||||
testCommand: ${{ inputs.builddir }}/tests/Material_tests_run --gtest_output=json:${{ inputs.reportdir }}measure_gtest_results.json
|
|
||||||
testLogFile: ${{ inputs.reportdir }}measure_gtest_test_log.txt
|
|
||||||
testName: Measure
|
|
||||||
- name: C++ Mesh tests
|
|
||||||
id: mesh
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
|
||||||
with:
|
|
||||||
testCommand: ${{ inputs.builddir }}/tests/Mesh_tests_run --gtest_output=json:${{ inputs.reportdir }}mesh_gtest_results.json
|
|
||||||
testLogFile: ${{ inputs.reportdir }}mesh_gtest_test_log.txt
|
|
||||||
testName: Mesh
|
|
||||||
- name: C++ MeshPart tests
|
|
||||||
id: meshpart
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
|
||||||
with:
|
|
||||||
testCommand: ${{ inputs.builddir }}/tests/Mesh_tests_run --gtest_output=json:${{ inputs.reportdir }}meshpart_gtest_results.json
|
|
||||||
testLogFile: ${{ inputs.reportdir }}meshpart_gtest_test_log.txt
|
|
||||||
testName: MeshPart
|
|
||||||
- name: C++ Misc tests
|
|
||||||
id: misc
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
|
||||||
with:
|
|
||||||
testCommand: ${{ inputs.builddir }}/tests/Misc_tests_run --gtest_output=json:${{ inputs.reportdir }}misc_gtest_results.json
|
|
||||||
testLogFile: ${{ inputs.reportdir }}misc_gtest_test_log.txt
|
|
||||||
testName: Misc
|
|
||||||
- name: C++ Part tests
|
|
||||||
id: part
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
|
||||||
with:
|
|
||||||
testCommand: ${{ inputs.builddir }}/tests/Part_tests_run --gtest_output=json:${{ inputs.reportdir }}part_gtest_results.json
|
|
||||||
testLogFile: ${{ inputs.reportdir }}Part_gtest_test_log.txt
|
|
||||||
testName: Part
|
|
||||||
- name: C++ PartDesign tests
|
|
||||||
id: partdesign
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
|
||||||
with:
|
|
||||||
testCommand: ${{ inputs.builddir }}/tests/PartDesign_tests_run --gtest_output=json:${{ inputs.reportdir }}partdesign_gtest_results.json
|
|
||||||
testLogFile: ${{ inputs.reportdir }}PartDesign_gtest_test_log.txt
|
|
||||||
testName: PartDesign
|
|
||||||
- name: C++ Points tests
|
|
||||||
id: points
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
|
||||||
with:
|
|
||||||
testCommand: ${{ inputs.builddir }}/tests/Points_tests_run --gtest_output=json:${{ inputs.reportdir }}points_gtest_results.json
|
|
||||||
testLogFile: ${{ inputs.reportdir }}points_gtest_test_log.txt
|
|
||||||
testName: Points
|
|
||||||
- name: C++ Sketcher tests
|
|
||||||
id: sketcher
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
|
||||||
with:
|
|
||||||
testCommand: ${{ inputs.builddir }}/tests/Sketcher_tests_run --gtest_output=json:${{ inputs.reportdir }}sketcher_gtest_results.json
|
|
||||||
testLogFile: ${{ inputs.reportdir }}sketcher_gtest_test_log.txt
|
|
||||||
testName: Sketcher
|
|
||||||
- name: C++ Spreadsheet tests
|
|
||||||
id: spreadsheet
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
|
||||||
with:
|
|
||||||
testCommand: ${{ inputs.builddir }}/tests/Sketcher_tests_run --gtest_output=json:${{ inputs.reportdir }}spreadsheet_gtest_results.json
|
|
||||||
testLogFile: ${{ inputs.reportdir }}spreadsheet_gtest_test_log.txt
|
|
||||||
testName: Spreadsheet
|
|
||||||
- name: C++ Start tests
|
|
||||||
id: start
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
|
||||||
with:
|
|
||||||
testCommand: ${{ inputs.builddir }}/tests/Start_tests_run --gtest_output=json:${{ inputs.reportdir }}start_gtest_results.json
|
|
||||||
testLogFile: ${{ inputs.reportdir }}start_gtest_test_log.txt
|
|
||||||
testName: Start
|
|
||||||
- name: Compose summary report based on test results
|
|
||||||
if: always()
|
|
||||||
shell: bash -l {0}
|
|
||||||
run: |
|
|
||||||
# Print global result
|
|
||||||
if [ ${{ job.status }} != "success" ]
|
|
||||||
then
|
|
||||||
echo "<details><summary>:fire: C++ tests failed</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
else
|
|
||||||
echo "<details><summary>:heavy_check_mark: C++ tests succeeded</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
fi
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
echo "<blockquote>" >> ${{ inputs.reportFile }}
|
|
||||||
#Extract individual results
|
|
||||||
cat > /tmp/data << "EOD"
|
|
||||||
${{ toJSON(steps) }}
|
|
||||||
EOD
|
|
||||||
echo "$(jq -r ".[].outputs.reportText" /tmp/data)" >> ${{ inputs.reportFile }}
|
|
||||||
# Close report
|
|
||||||
echo "</blockquote>" >> ${{ inputs.reportFile }}
|
|
||||||
echo "</details>" >> ${{ inputs.reportFile }}
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * Copyright (c) 2023 FreeCAD Project Association *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
name: runCPPTests
|
|
||||||
description: "Run C++ tests, generate log and report"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
testCommand:
|
|
||||||
description: "Test command to be run"
|
|
||||||
required: true
|
|
||||||
testLogFile:
|
|
||||||
description: "Path for the command-line output of the tests"
|
|
||||||
required: true
|
|
||||||
testName:
|
|
||||||
description: "A descriptive name for the test suite"
|
|
||||||
required: true
|
|
||||||
outputs:
|
|
||||||
reportText:
|
|
||||||
description: "Report text"
|
|
||||||
value: ${{ steps.report.outputs.reportText }}
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Run C++ tests
|
|
||||||
shell: bash -l {0}
|
|
||||||
run: |
|
|
||||||
set -o pipefail
|
|
||||||
${{ inputs.testCommand }} | tee -a ${{ inputs.testLogFile }}
|
|
||||||
- name: Parse test results
|
|
||||||
if: always()
|
|
||||||
id: report
|
|
||||||
shell: bash -l {0}
|
|
||||||
run: |
|
|
||||||
result=$(sed -ne "/Global test environment tear-down/,/^$/{/^$/d;p}" ${{ inputs.testLogFile }})
|
|
||||||
if grep -qF "[ FAILED ]" <<< $result
|
|
||||||
then
|
|
||||||
reportText="<details><summary>:fire: GTest C++ test suite '${{ inputs.testName }}' failed</summary>\n"
|
|
||||||
else
|
|
||||||
reportText="<details><summary>:heavy_check_mark: GTest C++ test suite '${{ inputs.testName }}' succeeded</summary>\n"
|
|
||||||
fi
|
|
||||||
reportText+="\n"
|
|
||||||
reportText+="Results\n"
|
|
||||||
reportText+="\n"
|
|
||||||
reportText+='```\n'
|
|
||||||
reportText+="$result\n"
|
|
||||||
reportText+='```\n'
|
|
||||||
reportText+="</details>\n"
|
|
||||||
reportText+="\n"
|
|
||||||
echo "reportText<<EOD" >> $GITHUB_OUTPUT
|
|
||||||
echo -e "$reportText" >> $GITHUB_OUTPUT
|
|
||||||
echo "EOD" >> $GITHUB_OUTPUT
|
|
||||||
echo -e "$reportText"
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
name: runPythonTests
|
|
||||||
description: "Run Python tests, generate log and report"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
testDescription:
|
|
||||||
description: "Test description text, will be used on report"
|
|
||||||
required: true
|
|
||||||
testCommand:
|
|
||||||
description: "Test command to be run"
|
|
||||||
required: true
|
|
||||||
logFile:
|
|
||||||
description: "Path for log file"
|
|
||||||
required: true
|
|
||||||
reportFile:
|
|
||||||
description: "Path for report file"
|
|
||||||
required: true
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Run tests
|
|
||||||
id: runTests
|
|
||||||
shell: bash -l {0}
|
|
||||||
run: |
|
|
||||||
set -o pipefail
|
|
||||||
${{ inputs.testCommand }} | sed -Ee "/[[:blank:]]*\([[:digit:]]{1,3} %\)[[:blank:]]*/d" | tee -a ${{ inputs.logFile }}
|
|
||||||
- name: Write report
|
|
||||||
shell: bash -l {0}
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
sed -ne "/^\(FAILED\|ERROR\):/,/^[[:blank:]]*$/bF; /^Traceback/,/^[^[:blank:]]/{/^Traceback/bT; /^[^[:blank:]]/G; bT}; b; :T w ${{ inputs.logFile }}_tracebacks" -e "b; :F w ${{ inputs.logFile }}_failedtests" ${{ inputs.logFile }}
|
|
||||||
icon=""
|
|
||||||
if [ $( cat ${{ inputs.logFile }}_tracebacks | wc -l ) -gt 0 ]
|
|
||||||
then
|
|
||||||
icon=" :fire:"
|
|
||||||
fi
|
|
||||||
if [ ${{ steps.runTests.outcome }} == 'success' ]
|
|
||||||
then
|
|
||||||
echo "<details><summary>:heavy_check_mark: ${{ inputs.testDescription }} succeeded$icon</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
else
|
|
||||||
echo "<details><summary>:fire: ${{ inputs.testDescription }} failed$icon</summary>" >> ${{ inputs.reportFile }}
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
echo "Failed tests" >> ${{ inputs.reportFile }}
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
cat ${{ inputs.logFile }}_failedtests >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
fi
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
if [ $( cat ${{ inputs.logFile }}_tracebacks | wc -l ) -gt 0 ]
|
|
||||||
then
|
|
||||||
echo "Uncaught tracebacks -- these tracebacks appeared during test but didn't fail a test --" >> ${{ inputs.reportFile }}
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
cat ${{ inputs.logFile }}_tracebacks >> ${{ inputs.reportFile }}
|
|
||||||
echo '```' >> ${{ inputs.reportFile }}
|
|
||||||
fi
|
|
||||||
echo "</details>">> ${{ inputs.reportFile }}
|
|
||||||
echo "" >> ${{ inputs.reportFile }}
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
# This action aims at speeding up CI and reduce dependency to external resources
|
|
||||||
# by creating a cache of Ccache needed binaries then using it for CI runs rather
|
|
||||||
# than downloading every time.
|
|
||||||
#
|
|
||||||
# If it needs to be updated to another version, the process it to change
|
|
||||||
# 'downloadpath' and 'version' inputs below then delete the existing cache
|
|
||||||
# from Github interface so a new one is generated using new values.
|
|
||||||
|
|
||||||
name: getCcache
|
|
||||||
description: "Windows: tries to get a cached version of Ccache and create one if fails"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
ccachebindir:
|
|
||||||
description: "Directory where ccache binaries shall be stored"
|
|
||||||
required: true
|
|
||||||
# Below inputs shall generally not be provided as they won't be used if a cached version exists
|
|
||||||
# They are mainly used because Github do not support adding env variables in a composite action
|
|
||||||
ccachedownloadpath:
|
|
||||||
description: "Path where to download ccache"
|
|
||||||
required: false
|
|
||||||
default: https://github.com/ccache/ccache/releases/download/v4.9/
|
|
||||||
ccacheversion:
|
|
||||||
description: "Ccache version to be downloaded"
|
|
||||||
required: false
|
|
||||||
default: ccache-4.9-windows-x86_64
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Create destination directory
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
mkdir -p ${{ inputs.ccachebindir }}
|
|
||||||
- name: Get cached version
|
|
||||||
uses: actions/cache/restore@v4
|
|
||||||
id: getCached
|
|
||||||
with:
|
|
||||||
path: ${{ inputs.ccachebindir }}
|
|
||||||
key: ccacheforwin-${{ inputs.ccacheversion }}
|
|
||||||
- name: Download ccache
|
|
||||||
shell: bash
|
|
||||||
if: steps.getCached.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
curl -L -o ccache.zip ${{ inputs.ccachedownloadpath }}${{ inputs.ccacheversion }}.zip
|
|
||||||
7z x ccache.zip -o"ccachetemp" -r -y
|
|
||||||
cp -a ccachetemp/${{ inputs.ccacheversion }}/ccache.exe ${{ inputs.ccachebindir }}
|
|
||||||
cp -a ccachetemp/${{ inputs.ccacheversion }}/ccache.exe ${{ inputs.ccachebindir }}/cl.exe
|
|
||||||
rm ccache.zip
|
|
||||||
rm -rf ccachetemp
|
|
||||||
- name: Save version to cache
|
|
||||||
if: steps.getCached.outputs.cache-hit != 'true'
|
|
||||||
uses: actions/cache/save@v4
|
|
||||||
with:
|
|
||||||
path: ${{ inputs.ccachebindir }}
|
|
||||||
key: ${{ steps.getCached.outputs.cache-primary-key }}
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
# This action aims at speeding up CI and reduce dependency to external resources
|
|
||||||
# by creating a cache of Libpack needed files then using it for CI runs rather
|
|
||||||
# than downloading every time.
|
|
||||||
#
|
|
||||||
# If it needs to be updated to another version, the process it to change
|
|
||||||
# 'downloadpath' and 'version' inputs below then delete the existing cache
|
|
||||||
# from Github interface so a new one is generated using new values.
|
|
||||||
|
|
||||||
name: getLibpack
|
|
||||||
description: "Windows: tries to get a cached version of Libpack and create one if fails"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
libpackdir:
|
|
||||||
description: "Directory where libpack files shall be stored"
|
|
||||||
required: true
|
|
||||||
# Below inputs shall generally not be provided as they won't be used if a cached version exists
|
|
||||||
# They are mainly used because Github do not support adding env variables in a composite action
|
|
||||||
libpackdownloadurl:
|
|
||||||
description: "URL where to download libpack"
|
|
||||||
required: false
|
|
||||||
default: https://github.com/FreeCAD/FreeCAD-LibPack/releases/download/3.1.1.3/LibPack-1.1.0-v3.1.1.3-Release.7z
|
|
||||||
libpackname:
|
|
||||||
description: "Libpack name (once downloaded)"
|
|
||||||
required: false
|
|
||||||
default: LibPack-1.1.0-v3.1.1.3-Release
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Create destination directory
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
mkdir -p ${{ inputs.libpackdir }}
|
|
||||||
- name: Get cached version
|
|
||||||
uses: actions/cache/restore@v4
|
|
||||||
id: getCached
|
|
||||||
with:
|
|
||||||
path: ${{ inputs.libpackdir }}
|
|
||||||
key: libpackforwin-${{ inputs.libpackname }}
|
|
||||||
- name: Download libpack
|
|
||||||
shell: bash
|
|
||||||
if: steps.getCached.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
curl -L -o libpack.7z ${{ inputs.libpackdownloadurl }}
|
|
||||||
7z x libpack.7z -o"libpacktemp" -r -y
|
|
||||||
mv libpacktemp/${{ inputs.libpackname }}/* ${{ inputs.libpackdir }}
|
|
||||||
rm -rf libpacktemp
|
|
||||||
- name: Save version to cache
|
|
||||||
if: steps.getCached.outputs.cache-hit != 'true'
|
|
||||||
uses: actions/cache/save@v4
|
|
||||||
with:
|
|
||||||
path: ${{ inputs.libpackdir }}
|
|
||||||
key: ${{ steps.getCached.outputs.cache-primary-key }}
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
# This workflow warns and then closes issues that have had no activity for a
|
|
||||||
# specified amount of time. You can adjust the behavior by modifying this file.
|
|
||||||
# For more information, see:
|
|
||||||
# https://github.com/marketplace/actions/close-stale-issues
|
|
||||||
# https://github.com/actions/stale/blob/master/action.yml
|
|
||||||
# https://github.com/actions/stale
|
|
||||||
---
|
|
||||||
name: 'Stale Issues'
|
|
||||||
on: # yamllint disable-line rule:truthy
|
|
||||||
schedule:
|
|
||||||
- cron: '0 0 * * *' # Run at 00:00 UTC every day
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
issues: write # for actions/stale to close stale issues
|
|
||||||
pull-requests: write # for actions/stale to close stale pull requests
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
stale:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
- name: '🧹 Tag & close stale unconfirmed bugs'
|
|
||||||
id: stale_issues
|
|
||||||
uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
days-before-issue-stale: 90
|
|
||||||
days-before-issue-close: 14
|
|
||||||
days-before-pr-stale: -1
|
|
||||||
days-before-pr-close: -1
|
|
||||||
operations-per-run: 200 # max num of ops per run
|
|
||||||
stale-issue-label: 'Status: Stale'
|
|
||||||
close-issue-label: 'Status: Auto-closing'
|
|
||||||
exempt-issue-labels: 'Status: Confirmed,Priority: High,Priority: Critical,Blocker,Type: Feature,no-auto-close,3rd party: OCC'
|
|
||||||
remove-stale-when-updated: true
|
|
||||||
ascending: true
|
|
||||||
stale-issue-message: |
|
|
||||||
Hi! This issue hasn’t seen activity in a while. If it’s still relevant, please update to the latest FreeCAD weekly build [download here](https://github.com/FreeCAD/FreeCAD/releases/) to see if the problem is resolved.
|
|
||||||
|
|
||||||
If the issue persists, let us know by adding a comment with any updates or details. Otherwise, we’ll close this issue automatically in 14 days to keep our backlog tidy. Feel free to comment anytime to keep it open. Closed issues can always be reopened.
|
|
||||||
Thanks for helping improve FreeCAD!
|
|
||||||
|
|
||||||
Access additional [FreeCAD](https://freecad.org) resources:
|
|
||||||
- **Forum**: https://forum.freecad.org
|
|
||||||
- **Blog**: https://blog.freecad.org
|
|
||||||
- **Wiki**: https://wiki.freecad.org
|
|
||||||
|
|
||||||
- name: '🧹 Close stale requested feedback issues'
|
|
||||||
id: awaiting_issues
|
|
||||||
uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
days-before-issue-stale: 20
|
|
||||||
days-before-issue-close: 14
|
|
||||||
days-before-pr-stale: -1
|
|
||||||
days-before-pr-close: -1
|
|
||||||
operations-per-run: 100 # max num of ops per run
|
|
||||||
stale-issue-label: 'Status: Stale'
|
|
||||||
close-issue-label: 'Status: Auto-closing'
|
|
||||||
only-labels: 'Status: Needs feedback,Status: Needs test on dev version,Status: Needs steps to reproduce'
|
|
||||||
remove-stale-when-updated: true
|
|
||||||
ascending: true
|
|
||||||
stale-issue-message: |
|
|
||||||
Hi! This issue hasn’t seen activity in a while despite the need for further feedback.
|
|
||||||
If it’s still relevant, please update to the latest FreeCAD weekly build [download here](https://github.com/FreeCAD/FreeCAD/releases/) to see if the problem is resolved.
|
|
||||||
|
|
||||||
If the issue persists, let us know by adding a comment with any updates or details. Otherwise, we’ll close this issue automatically in 14 days to keep our backlog tidy. Feel free to comment anytime to keep it open. Closed issues can always be reopened.
|
|
||||||
Thanks for helping improve FreeCAD!
|
|
||||||
|
|
||||||
Access additional [FreeCAD](https://freecad.org) resources:
|
|
||||||
- **Forum**: https://forum.freecad.org
|
|
||||||
- **Blog**: https://blog.freecad.org
|
|
||||||
- **Wiki**: https://wiki.freecad.org
|
|
||||||
|
|
||||||
- name: '🧹 Tag & close inactive issues'
|
|
||||||
id: inactive_issues
|
|
||||||
uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
days-before-issue-stale: 190
|
|
||||||
days-before-issue-close: 60
|
|
||||||
days-before-pr-stale: -1
|
|
||||||
days-before-pr-close: -1
|
|
||||||
operations-per-run: 100 # max num of ops per run
|
|
||||||
stale-issue-label: 'Status: Stale'
|
|
||||||
close-issue-label: 'Status: Auto-closing'
|
|
||||||
exempt-issue-labels: 'Priority: High,Priority: Critical,Blocker,Type: Feature,no-auto-close,3rd party: OCC'
|
|
||||||
remove-stale-when-updated: true
|
|
||||||
ascending: true
|
|
||||||
stale-issue-message: |
|
|
||||||
Hi! This issue hasn’t seen activity in a while. We automatically check each issue after 190 days without activity to keep the backlog tidy.
|
|
||||||
If it’s still relevant, please update to the latest FreeCAD weekly build [download here](https://github.com/FreeCAD/FreeCAD/releases/) to see if the issue is already resolved.
|
|
||||||
|
|
||||||
If the issue is still relevant, let us know by adding a comment.
|
|
||||||
Otherwise, we’ll close this issue automatically in 60 days.
|
|
||||||
|
|
||||||
Feel free to comment anytime to keep it open. Closed issues can always be reopened.
|
|
||||||
Thanks for helping improve FreeCAD!
|
|
||||||
|
|
||||||
Access additional [FreeCAD](https://freecad.org) resources:
|
|
||||||
- **Forum**: https://forum.freecad.org
|
|
||||||
- **Blog**: https://blog.freecad.org
|
|
||||||
- **Wiki**: https://wiki.freecad.org
|
|
||||||
|
|
||||||
- name: '🧹 Tag & close inactive PRs'
|
|
||||||
id: inactive_pr
|
|
||||||
uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
days-before-issue-stale: -1
|
|
||||||
days-before-issue-close: -1
|
|
||||||
days-before-pr-stale: 120
|
|
||||||
days-before-pr-close: 60
|
|
||||||
operations-per-run: 30 # max num of ops per run
|
|
||||||
stale-pr-label: 'Status: Stale'
|
|
||||||
close-pr-label: 'Status: Auto-closing'
|
|
||||||
exempt-pr-labels: 'Needs backport,Priority: High,Priority: Critical,no-auto-close'
|
|
||||||
remove-stale-when-updated: true
|
|
||||||
ascending: true
|
|
||||||
stale-pr-message: |
|
|
||||||
Thanks for helping improve FreeCAD!
|
|
||||||
This pull request hasn’t seen activity in a while. We automatically check each PR after 120 days without activity to keep the repository tidy.
|
|
||||||
|
|
||||||
If the PR is still relevant, let us know by adding a comment.
|
|
||||||
Otherwise, we’ll close this PR automatically in 60 days.
|
|
||||||
|
|
||||||
If you would like to keep working on this pull request, we advice to rebase it on current main branch, ask feedback from users or maintainers and engage with the community to get it forward.
|
|
||||||
52
.github/workflows/backport.yml
vendored
52
.github/workflows/backport.yml
vendored
@@ -1,52 +0,0 @@
|
|||||||
name: Backport merged pull request
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types: [closed, labeled]
|
|
||||||
branches: [main, releases/*]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
backport:
|
|
||||||
name: Create backport pull request
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
# Run the action if a PR is merged with backport labels
|
|
||||||
# OR
|
|
||||||
# when already merged PR is labeled with backport labels
|
|
||||||
if: >
|
|
||||||
github.event.pull_request.merged
|
|
||||||
&& (
|
|
||||||
github.event.action == 'closed'
|
|
||||||
|| (
|
|
||||||
github.event.action == 'labeled'
|
|
||||||
&& startsWith(github.event.label.name, 'backport ')
|
|
||||||
)
|
|
||||||
)
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GH_TOKEN_FOR_CI_RUNNERS }}
|
|
||||||
|
|
||||||
- name: Create backport pull requests
|
|
||||||
uses: korthout/backport-action@d07416681cab29bf2661702f925f020aaa962997 # v3.4.1
|
|
||||||
with:
|
|
||||||
# Inputs documented here: https://github.com/korthout/backport-action?tab=readme-ov-file#inputs
|
|
||||||
github_token: ${{ secrets.GH_TOKEN_FOR_CI_RUNNERS }}
|
|
||||||
github_workspace: ${{ github.workspace }}
|
|
||||||
|
|
||||||
# permit PRs with merge commits to be backported
|
|
||||||
merge_commits: 'skip'
|
|
||||||
|
|
||||||
# copy labels to backport to identify affected systems and priorities
|
|
||||||
copy_labels_pattern: '.*'
|
|
||||||
|
|
||||||
# Regex pattern to match github labels
|
|
||||||
# The capture group catches the target branch
|
|
||||||
# i.e. label "backport releases/FreeCAD-1-0" will create backport
|
|
||||||
# PR for branch releases/FreeCAD-1-0
|
|
||||||
label_pattern: ^backport ([^ ]+)$
|
|
||||||
209
.github/workflows/build_release.yml
vendored
209
.github/workflows/build_release.yml
vendored
@@ -1,209 +0,0 @@
|
|||||||
name: Build Release
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [created]
|
|
||||||
schedule:
|
|
||||||
- cron: "0 0 * * 3"
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
actions: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
upload_src:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
build_tag: ${{ steps.get_tag.outputs.build_tag }}
|
|
||||||
steps:
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
- name: Checkout Source
|
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
with:
|
|
||||||
ref: ${{ github.sha }}
|
|
||||||
fetch-depth: 2
|
|
||||||
fetch-tags: true
|
|
||||||
submodules: 'recursive'
|
|
||||||
|
|
||||||
- name: get tag and create release if weekly
|
|
||||||
id: get_tag
|
|
||||||
shell: bash -l {0}
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
|
||||||
if [ "${{ github.event_name }}" = "release" ]; then
|
|
||||||
export BUILD_TAG="${{ github.event.release.tag_name }}"
|
|
||||||
else
|
|
||||||
export BUILD_TAG=weekly-$(date "+%Y.%m.%d")
|
|
||||||
gh release create ${BUILD_TAG} --title "Development Build ${BUILD_TAG}" -F .github/workflows/weekly-build-notes.md --prerelease || true
|
|
||||||
fi
|
|
||||||
echo "BUILD_TAG=${BUILD_TAG}" >> "$GITHUB_ENV"
|
|
||||||
echo "build_tag=${BUILD_TAG}" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Trigger notes updater workflow (only for weekly)
|
|
||||||
if: startsWith(steps.get_tag.outputs.build_tag, 'weekly-')
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
env:
|
|
||||||
WEEKLY_TAG: ${{ steps.get_tag.outputs.build_tag }}
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const owner = context.repo.owner;
|
|
||||||
const repo = context.repo.repo;
|
|
||||||
|
|
||||||
// Reusable/dispatchable updater workflow file in .github/workflows/
|
|
||||||
const workflow_id = 'weekly-compare-link.yml';
|
|
||||||
|
|
||||||
// Use the default branch so the workflow file is available
|
|
||||||
const ref = (context.payload?.repository?.default_branch) || 'main';
|
|
||||||
const current_tag = process.env.WEEKLY_TAG || '';
|
|
||||||
|
|
||||||
await github.rest.actions.createWorkflowDispatch({
|
|
||||||
owner, repo, workflow_id, ref,
|
|
||||||
inputs: { current_tag }
|
|
||||||
});
|
|
||||||
|
|
||||||
core.info(`Dispatched ${workflow_id} on ${ref} with current_tag='${current_tag}'.`)
|
|
||||||
|
|
||||||
- name: Upload Source
|
|
||||||
id: upload_source
|
|
||||||
shell: bash -l {0}
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
|
||||||
python3 package/scripts/write_version_info.py ../freecad_version.txt
|
|
||||||
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
|
|
||||||
git config user.name 'github-actions[bot]'
|
|
||||||
git apply package/disable_git_info.patch
|
|
||||||
git commit -a -m "Disable git info write to Version.h"
|
|
||||||
git archive HEAD -o freecad_source_${BUILD_TAG}.tar
|
|
||||||
git submodule foreach --recursive \
|
|
||||||
"git archive HEAD --prefix=\$path/ -o \$sha1.tar && \
|
|
||||||
tar -A -f \$toplevel/freecad_source_${BUILD_TAG}.tar \$sha1.tar && \
|
|
||||||
rm \$sha1.tar"
|
|
||||||
gzip freecad_source_${BUILD_TAG}.tar
|
|
||||||
sha256sum freecad_source_${BUILD_TAG}.tar.gz > freecad_source_${BUILD_TAG}.tar.gz-SHA256.txt
|
|
||||||
gh release upload --clobber ${BUILD_TAG} "freecad_source_${BUILD_TAG}.tar.gz" "freecad_source_${BUILD_TAG}.tar.gz-SHA256.txt"
|
|
||||||
|
|
||||||
build:
|
|
||||||
needs: upload_src
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- { target: linux-64, os: ubuntu-22.04 }
|
|
||||||
- { target: linux-arm64, os: ubuntu-22.04-arm }
|
|
||||||
- { target: osx-64, os: macos-15-intel }
|
|
||||||
- { target: osx-arm64, os: macos-latest }
|
|
||||||
- { target: win-64, os: windows-latest }
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
environment: weekly-build
|
|
||||||
steps:
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
# prevent running out of disk space on Ubuntu runners.
|
|
||||||
- name: Maximize build space
|
|
||||||
if: runner.os == 'Linux'
|
|
||||||
uses: AdityaGarg8/remove-unwanted-software@90e01b21170618765a73370fcc3abbd1684a7793 # v5
|
|
||||||
with:
|
|
||||||
verbose: 'true'
|
|
||||||
remove-android: 'true' # (frees ~9 GB)
|
|
||||||
remove-cached-tools: 'true' # (frees ~8.3 GB)
|
|
||||||
|
|
||||||
- name: Set Platform Environment Variables
|
|
||||||
shell: bash -l {0}
|
|
||||||
env:
|
|
||||||
OPERATING_SYSTEM: ${{ runner.os }}
|
|
||||||
run: |
|
|
||||||
if [[ $OPERATING_SYSTEM == 'Windows' ]]; then
|
|
||||||
echo 'PIXI_CACHE_DIR=D:\rattler' >> "$GITHUB_ENV"
|
|
||||||
echo 'RATTLER_CACHE_DIR=D:\rattler' >> "$GITHUB_ENV"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Checkout Source
|
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
with:
|
|
||||||
ref: ${{ github.sha }}
|
|
||||||
fetch-depth: 2
|
|
||||||
fetch-tags: true
|
|
||||||
submodules: 'recursive'
|
|
||||||
|
|
||||||
- uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
|
|
||||||
with:
|
|
||||||
pixi-version: v0.59.0
|
|
||||||
cache: false
|
|
||||||
|
|
||||||
- name: Install the Apple certificate and provisioning profile
|
|
||||||
id: get_cert
|
|
||||||
if: runner.os == 'macOS'
|
|
||||||
env:
|
|
||||||
APP_SPECIFIC_PASSWORD: ${{ secrets.APP_SPECIFIC_PASSWORD }}
|
|
||||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
|
||||||
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
|
|
||||||
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
|
|
||||||
DEVELOPER_TEAM_ID: ${{ secrets.DEVELOPER_TEAM_ID }}
|
|
||||||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
|
||||||
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
if [ -z "$BUILD_CERTIFICATE_BASE64" ]; then
|
|
||||||
echo "has_cert=false" >> $GITHUB_OUTPUT
|
|
||||||
echo "No certificate avalable... skipping" && exit 0
|
|
||||||
else
|
|
||||||
echo "has_cert=true" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
# create variables
|
|
||||||
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
|
|
||||||
PP_PATH=$RUNNER_TEMP/FreeCAD_bundle.provisionprofile
|
|
||||||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
|
|
||||||
|
|
||||||
export KEYCHAIN_PASSWORD=$(openssl rand -base64 8)
|
|
||||||
|
|
||||||
# import certificate and provisioning profile from secrets
|
|
||||||
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
|
|
||||||
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
|
|
||||||
|
|
||||||
# create temporary keychain
|
|
||||||
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
|
||||||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
|
|
||||||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
|
||||||
|
|
||||||
# import certificate to keychain
|
|
||||||
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
|
|
||||||
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
|
||||||
security list-keychain -d user -s $KEYCHAIN_PATH
|
|
||||||
|
|
||||||
# apply provisioning profile
|
|
||||||
mkdir -p ~/Library/Provisioning\ Profiles
|
|
||||||
cp $PP_PATH ~/Library/Provisioning\ Profiles
|
|
||||||
|
|
||||||
xcrun notarytool store-credentials "FreeCAD" --keychain "$KEYCHAIN_PATH" --apple-id "${APPLE_ID}" --password "${APP_SPECIFIC_PASSWORD}" --team-id "${DEVELOPER_TEAM_ID}"
|
|
||||||
|
|
||||||
- name: Build and Release Packages
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
|
|
||||||
SIGN_RELEASE: ${{ steps.get_cert.outputs.has_cert }}
|
|
||||||
TARGET_PLATFORM: ${{ matrix.target }}
|
|
||||||
MAKE_INSTALLER: "true"
|
|
||||||
UPLOAD_RELEASE: "true"
|
|
||||||
BUILD_TAG: ${{ needs.upload_src.outputs.build_tag }}
|
|
||||||
run: |
|
|
||||||
python3 package/scripts/write_version_info.py ../freecad_version.txt
|
|
||||||
cd package/rattler-build
|
|
||||||
pixi install
|
|
||||||
pixi run -e package create_bundle
|
|
||||||
|
|
||||||
## Needed if running on a self-hosted runner:
|
|
||||||
# - name: Clean up keychain and provisioning profile
|
|
||||||
# if: ${{ always() }}
|
|
||||||
# run: |
|
|
||||||
# security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
|
|
||||||
# rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.mobileprovision
|
|
||||||
127
.github/workflows/codeql.yml
vendored
127
.github/workflows/codeql.yml
vendored
@@ -1,127 +0,0 @@
|
|||||||
# For most projects, this workflow file will not need changing; you simply need
|
|
||||||
# to commit it to your repository.
|
|
||||||
#
|
|
||||||
# You may wish to alter this file to override the set of languages analyzed,
|
|
||||||
# or to provide custom queries or build logic.
|
|
||||||
#
|
|
||||||
# ******** NOTE ********
|
|
||||||
# We have attempted to detect the languages in your repository. Please check
|
|
||||||
# the `language` matrix defined below to confirm you have the correct set of
|
|
||||||
# supported CodeQL languages.
|
|
||||||
#
|
|
||||||
name: "CodeQL Advanced"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "main" ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ "main" ]
|
|
||||||
schedule:
|
|
||||||
- cron: '28 12 * * 6'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
analyze:
|
|
||||||
name: Analyze (${{ matrix.language }})
|
|
||||||
# Runner size impacts CodeQL analysis time. To learn more, please see:
|
|
||||||
# - https://gh.io/recommended-hardware-resources-for-running-codeql
|
|
||||||
# - https://gh.io/supported-runners-and-hardware-resources
|
|
||||||
# - https://gh.io/using-larger-runners (GitHub.com only)
|
|
||||||
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
|
|
||||||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
|
||||||
permissions:
|
|
||||||
# required for all workflows
|
|
||||||
security-events: write
|
|
||||||
|
|
||||||
# required to fetch internal or private CodeQL packs
|
|
||||||
packages: read
|
|
||||||
|
|
||||||
# only required for workflows in private repositories
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- language: actions
|
|
||||||
build-mode: none
|
|
||||||
# - language: c-cpp
|
|
||||||
# build-mode: autobuild
|
|
||||||
# - language: javascript-typescript
|
|
||||||
# build-mode: none
|
|
||||||
- language: python
|
|
||||||
build-mode: none
|
|
||||||
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
|
|
||||||
# Use `c-cpp` to analyze code written in C, C++ or both
|
|
||||||
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
|
|
||||||
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
|
|
||||||
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
|
|
||||||
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
|
|
||||||
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
|
|
||||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
|
||||||
steps:
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
# Add any setup steps before running the `github/codeql-action/init` action.
|
|
||||||
# This includes steps like installing compilers or runtimes (`actions/setup-node`
|
|
||||||
# or others). This is typically only required for manual builds.
|
|
||||||
# - name: Setup runtime (example)
|
|
||||||
# uses: actions/setup-example@v1
|
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
|
|
||||||
with:
|
|
||||||
languages: ${{ matrix.language }}
|
|
||||||
build-mode: ${{ matrix.build-mode }}
|
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
||||||
# By default, queries listed here will override any specified in a config file.
|
|
||||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
||||||
|
|
||||||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
|
||||||
# queries: security-extended
|
|
||||||
queries: security-and-quality
|
|
||||||
|
|
||||||
# Change the CodeQL Bundle version
|
|
||||||
# tools: https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.20.7/codeql-bundle-linux64.tar.gz
|
|
||||||
|
|
||||||
# Add exclusions
|
|
||||||
config: |
|
|
||||||
paths-ignore:
|
|
||||||
- src/Mod/Import/App/SCL_output/**
|
|
||||||
query-filters:
|
|
||||||
- exclude:
|
|
||||||
id: py/file-not-closed
|
|
||||||
|
|
||||||
# If the analyze step fails for one of the languages you are analyzing with
|
|
||||||
# "We were unable to automatically build your code", modify the matrix above
|
|
||||||
# to set the build mode to "manual" for that language. Then modify this step
|
|
||||||
# to build your code.
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
|
||||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
|
||||||
- if: matrix.build-mode == 'manual'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo 'If you are using a "manual" build mode for one or more of the' \
|
|
||||||
'languages you are analyzing, replace this with the commands to build' \
|
|
||||||
'your code, for example:'
|
|
||||||
echo ' make bootstrap'
|
|
||||||
echo ' make release'
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
|
|
||||||
with:
|
|
||||||
category: "/language:${{matrix.language}}"
|
|
||||||
163
.github/workflows/codeql_cpp.yml
vendored
163
.github/workflows/codeql_cpp.yml
vendored
@@ -1,163 +0,0 @@
|
|||||||
# For most projects, this workflow file will not need changing; you simply need
|
|
||||||
# to commit it to your repository.
|
|
||||||
#
|
|
||||||
# You may wish to alter this file to override the set of languages analyzed,
|
|
||||||
# or to provide custom queries or build logic.
|
|
||||||
#
|
|
||||||
# ******** NOTE ********
|
|
||||||
# We have attempted to detect the languages in your repository. Please check
|
|
||||||
# the `language` matrix defined below to confirm you have the correct set of
|
|
||||||
# supported CodeQL languages.
|
|
||||||
#
|
|
||||||
name: "CodeQL Advanced (c-cpp)"
|
|
||||||
|
|
||||||
on:
|
|
||||||
# push:
|
|
||||||
# branches: [ "main" ]
|
|
||||||
# pull_request:
|
|
||||||
# branches: [ "main" ]
|
|
||||||
schedule:
|
|
||||||
- cron: '28 12 * * 6'
|
|
||||||
workflow_dispatch: # Allow manual triggers
|
|
||||||
|
|
||||||
env:
|
|
||||||
CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: false
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
analyze:
|
|
||||||
name: Analyze (${{ matrix.language }})
|
|
||||||
# Runner size impacts CodeQL analysis time. To learn more, please see:
|
|
||||||
# - https://gh.io/recommended-hardware-resources-for-running-codeql
|
|
||||||
# - https://gh.io/supported-runners-and-hardware-resources
|
|
||||||
# - https://gh.io/using-larger-runners (GitHub.com only)
|
|
||||||
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
|
|
||||||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
|
||||||
permissions:
|
|
||||||
# required for all workflows
|
|
||||||
security-events: write
|
|
||||||
|
|
||||||
# required to fetch internal or private CodeQL packs
|
|
||||||
packages: read
|
|
||||||
|
|
||||||
# only required for workflows in private repositories
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
# - language: actions
|
|
||||||
# build-mode: none
|
|
||||||
- language: c-cpp
|
|
||||||
build-mode: autobuild
|
|
||||||
# - language: javascript-typescript
|
|
||||||
# build-mode: none
|
|
||||||
# - language: python
|
|
||||||
# build-mode: none
|
|
||||||
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
|
|
||||||
# Use `c-cpp` to analyze code written in C, C++ or both
|
|
||||||
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
|
|
||||||
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
|
|
||||||
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
|
|
||||||
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
|
|
||||||
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
|
|
||||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
|
||||||
steps:
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
# prevent running out of disk space on Ubuntu runners.
|
|
||||||
- name: Maximize build space
|
|
||||||
uses: AdityaGarg8/remove-unwanted-software@90e01b21170618765a73370fcc3abbd1684a7793 # v5
|
|
||||||
with:
|
|
||||||
verbose: 'true'
|
|
||||||
remove-android: 'true' # (frees ~9 GB)
|
|
||||||
remove-cached-tools: 'true' # (frees ~8.3 GB)
|
|
||||||
remove-haskell: 'true' # (frees ~5.2 GB)
|
|
||||||
remove-swapfile: 'true' # (frees ~4 GB)
|
|
||||||
remove-docker-images: 'true' # (frees ~3.2 GB)
|
|
||||||
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
# Install FreeCAD dependencies (cpp)
|
|
||||||
- name: Setup build environment
|
|
||||||
run: ./package/ubuntu/install-apt-packages.sh
|
|
||||||
|
|
||||||
# Add any setup steps before running the `github/codeql-action/init` action.
|
|
||||||
# This includes steps like installing compilers or runtimes (`actions/setup-node`
|
|
||||||
# or others). This is typically only required for manual builds.
|
|
||||||
# - name: Setup runtime (example)
|
|
||||||
# uses: actions/setup-example@v1
|
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
|
|
||||||
with:
|
|
||||||
languages: ${{ matrix.language }}
|
|
||||||
build-mode: ${{ matrix.build-mode }}
|
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
||||||
# By default, queries listed here will override any specified in a config file.
|
|
||||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
||||||
|
|
||||||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
|
||||||
# queries: security-extended
|
|
||||||
queries: security-and-quality
|
|
||||||
|
|
||||||
# Change the CodeQL Bundle version
|
|
||||||
# tools: https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.20.7/codeql-bundle-linux64.tar.gz
|
|
||||||
|
|
||||||
# If the analyze step fails for one of the languages you are analyzing with
|
|
||||||
# "We were unable to automatically build your code", modify the matrix above
|
|
||||||
# to set the build mode to "manual" for that language. Then modify this step
|
|
||||||
# to build your code.
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
|
||||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
|
||||||
- if: matrix.build-mode == 'manual'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo 'If you are using a "manual" build mode for one or more of the' \
|
|
||||||
'languages you are analyzing, replace this with the commands to build' \
|
|
||||||
'your code, for example:'
|
|
||||||
echo ' make bootstrap'
|
|
||||||
echo ' make release'
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
|
|
||||||
with:
|
|
||||||
category: "/language:${{matrix.language}}"
|
|
||||||
output: sarif-results
|
|
||||||
upload: failure-only
|
|
||||||
|
|
||||||
- name: filter-sarif
|
|
||||||
uses: advanced-security/filter-sarif@v1
|
|
||||||
with:
|
|
||||||
patterns: |
|
|
||||||
-tests/**/*
|
|
||||||
-src/3rdParty/**/*
|
|
||||||
-**/ui_*.h
|
|
||||||
-**/moc_*.cpp
|
|
||||||
input: sarif-results/cpp.sarif
|
|
||||||
output: sarif-results/cpp.sarif
|
|
||||||
|
|
||||||
- name: Upload SARIF
|
|
||||||
uses: github/codeql-action/upload-sarif@v3
|
|
||||||
with:
|
|
||||||
sarif_file: sarif-results/cpp.sarif
|
|
||||||
|
|
||||||
- name: Upload loc as a Build Artifact
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: sarif-results
|
|
||||||
path: sarif-results
|
|
||||||
retention-days: 1
|
|
||||||
27
.github/workflows/dependency-review.yml
vendored
27
.github/workflows/dependency-review.yml
vendored
@@ -1,27 +0,0 @@
|
|||||||
# Dependency Review Action
|
|
||||||
#
|
|
||||||
# This Action will scan dependency manifest files that change as part of a Pull Request,
|
|
||||||
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
|
|
||||||
# Once installed, if the workflow run is marked as required,
|
|
||||||
# PRs introducing known-vulnerable packages will be blocked from merging.
|
|
||||||
#
|
|
||||||
# Source repository: https://github.com/actions/dependency-review-action
|
|
||||||
name: 'Dependency Review'
|
|
||||||
on: [pull_request]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
dependency-review:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
- name: 'Checkout Repository'
|
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
- name: 'Dependency Review'
|
|
||||||
uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4
|
|
||||||
39
.github/workflows/fedora-daily.yml
vendored
39
.github/workflows/fedora-daily.yml
vendored
@@ -1,39 +0,0 @@
|
|||||||
name: Fedora Daily Build
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "00 00 * * *"
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
trigger-copr-build:
|
|
||||||
environment: fedora-daily
|
|
||||||
env:
|
|
||||||
copr_login: ${{ secrets.COPR_LOGIN }}
|
|
||||||
copr_username: ${{ secrets.COPR_USERNAME }}
|
|
||||||
copr_token: ${{ secrets.COPR_TOKEN }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container: quay.io/packit/packit
|
|
||||||
steps:
|
|
||||||
- name: setup copr token
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.config
|
|
||||||
echo \
|
|
||||||
"[copr-cli]
|
|
||||||
login = $copr_login
|
|
||||||
username = $copr_username
|
|
||||||
token = $copr_token
|
|
||||||
copr_url = https://copr.fedorainfracloud.org
|
|
||||||
" > ~/.config/copr
|
|
||||||
- name: checkout sources
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
fetch-depth: 500
|
|
||||||
fetch-tags: true
|
|
||||||
- name: Setup safe Git directory
|
|
||||||
run: git config --global --add safe.directory $GITHUB_WORKSPACE
|
|
||||||
- name: trigger copr build
|
|
||||||
run: |
|
|
||||||
packit build in-copr --project freecad
|
|
||||||
68
.github/workflows/fetch_crowdin_translations.yml
vendored
68
.github/workflows/fetch_crowdin_translations.yml
vendored
@@ -1,68 +0,0 @@
|
|||||||
name: Fetch Crowdin Translations
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 0 * * 1"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-crowdin:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
token: ${{ secrets.GH_TOKEN_FOR_CROWDIN_SYNC }}
|
|
||||||
|
|
||||||
- name: Install Qt ≥ 6.8
|
|
||||||
uses: jurplel/install-qt-action@d325aaf2a8baeeda41ad0b5d39f84a6af9bcf005
|
|
||||||
with:
|
|
||||||
aqtversion: "==3.1.*"
|
|
||||||
version: "6.8.3"
|
|
||||||
host: "linux"
|
|
||||||
target: "desktop"
|
|
||||||
arch: "linux_gcc_64"
|
|
||||||
|
|
||||||
- name: Setup Python & dependencies
|
|
||||||
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
|
|
||||||
with:
|
|
||||||
python-version: "3.13"
|
|
||||||
- name: Install Python packages
|
|
||||||
run: |
|
|
||||||
python3 -m pip install --upgrade pip
|
|
||||||
pip install pyside6
|
|
||||||
|
|
||||||
- name: Gather translations from crowdin
|
|
||||||
run: |
|
|
||||||
./updatecrowdin.py build
|
|
||||||
while ./updatecrowdin.py build-status | grep -q "status: inProgress"; do sleep 10; done
|
|
||||||
./updatecrowdin.py download
|
|
||||||
./updatecrowdin.py install
|
|
||||||
working-directory: ./src/Tools
|
|
||||||
env:
|
|
||||||
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
|
|
||||||
CROWDIN_PROJECT_ID: freecad
|
|
||||||
|
|
||||||
- name: Commit changes
|
|
||||||
run: |
|
|
||||||
git config --global user.name "freecad-gh-actions-translation-bot"
|
|
||||||
git config --global user.email "freecad-gh-actions-translation-bot@github.com"
|
|
||||||
git add src
|
|
||||||
git commit -m "Update translations from Crowdin" || echo "No changes to commit"
|
|
||||||
|
|
||||||
- name: Push changes to a new branch
|
|
||||||
run: |
|
|
||||||
git branch update-crowdin-translations
|
|
||||||
git push origin update-crowdin-translations --force
|
|
||||||
|
|
||||||
- name: Create Pull Request
|
|
||||||
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676
|
|
||||||
with:
|
|
||||||
branch: update-crowdin-translations
|
|
||||||
title: "Update translations from Crowdin"
|
|
||||||
body: "Automatic Crowdin update."
|
|
||||||
token: ${{ secrets.GH_TOKEN_FOR_CROWDIN_SYNC }}
|
|
||||||
delete-branch: true
|
|
||||||
add-paths: |
|
|
||||||
src
|
|
||||||
49
.github/workflows/issue-metrics.yml
vendored
49
.github/workflows/issue-metrics.yml
vendored
@@ -1,49 +0,0 @@
|
|||||||
name: Monthly issue metrics
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 0 15 * *'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
pull-requests: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: issue metrics
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository_owner == 'FreeCAD'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
- name: Get dates for last month
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
# Calculate the first day of the previous month
|
|
||||||
first_day=$(date -d "last month" +%Y-%m-15)
|
|
||||||
|
|
||||||
# Calculate the last day of the previous month
|
|
||||||
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
|
|
||||||
|
|
||||||
#Set an environment variable with the date range
|
|
||||||
echo "$first_day..$last_day"
|
|
||||||
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- name: Run issue-metrics tool
|
|
||||||
uses: github/issue-metrics@67526e7bd8100b870f10b1c120780a8375777b43 # v3.25.5
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
SEARCH_QUERY: 'repo:FreeCAD/FreeCAD is:issue created:${{ env.last_month }}'
|
|
||||||
|
|
||||||
- name: Create issue
|
|
||||||
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6.0.0
|
|
||||||
with:
|
|
||||||
title: Monthly issue metrics report
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
content-filepath: ./issue_metrics.md
|
|
||||||
assignees: maxwxyz
|
|
||||||
32
.github/workflows/labeler.yml
vendored
32
.github/workflows/labeler.yml
vendored
@@ -1,32 +0,0 @@
|
|||||||
# This workflow will triage pull requests and apply a label based on the
|
|
||||||
# paths that are modified in the pull request.
|
|
||||||
#
|
|
||||||
# For more information, see:
|
|
||||||
# https://github.com/actions/labeler
|
|
||||||
|
|
||||||
name: Labeler
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types: [opened, reopened]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
label:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
|
|
||||||
with:
|
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
configuration-path: ".github/labels.yml"
|
|
||||||
sync-labels: false
|
|
||||||
43
.github/workflows/push_crowdin_translations.yml
vendored
43
.github/workflows/push_crowdin_translations.yml
vendored
@@ -1,43 +0,0 @@
|
|||||||
name: Push Crowdin Translations
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 0 * * 1"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-crowdin:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
ref: releases/FreeCAD-1-1
|
|
||||||
|
|
||||||
- name: Install Qt ≥ 6.8
|
|
||||||
uses: jurplel/install-qt-action@d325aaf2a8baeeda41ad0b5d39f84a6af9bcf005
|
|
||||||
with:
|
|
||||||
aqtversion: "==3.1.*"
|
|
||||||
version: "6.8.3"
|
|
||||||
host: "linux"
|
|
||||||
target: "desktop"
|
|
||||||
arch: "linux_gcc_64"
|
|
||||||
|
|
||||||
- name: Setup Python & dependencies
|
|
||||||
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
|
|
||||||
with:
|
|
||||||
python-version: "3.13"
|
|
||||||
- name: Install Python packages
|
|
||||||
run: |
|
|
||||||
python3 -m pip install --upgrade pip
|
|
||||||
pip install pyside6
|
|
||||||
|
|
||||||
- name: Push translations to Crowdin
|
|
||||||
run: |
|
|
||||||
./updatecrowdin.py gather
|
|
||||||
./updatecrowdin.py upload
|
|
||||||
working-directory: ./src/Tools
|
|
||||||
env:
|
|
||||||
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
|
|
||||||
CROWDIN_PROJECT_ID: freecad
|
|
||||||
81
.github/workflows/scorecards.yml
vendored
81
.github/workflows/scorecards.yml
vendored
@@ -1,81 +0,0 @@
|
|||||||
# This workflow uses actions that are not certified by GitHub. They are provided
|
|
||||||
# by a third-party and are governed by separate terms of service, privacy
|
|
||||||
# policy, and support documentation.
|
|
||||||
|
|
||||||
name: Scorecard supply-chain security
|
|
||||||
on:
|
|
||||||
# For Branch-Protection check. Only the default branch is supported. See
|
|
||||||
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
|
|
||||||
branch_protection_rule:
|
|
||||||
# To guarantee Maintained check is occasionally updated. See
|
|
||||||
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
|
|
||||||
schedule:
|
|
||||||
- cron: '20 7 * * 2'
|
|
||||||
push:
|
|
||||||
branches: ["main"]
|
|
||||||
|
|
||||||
# Declare default permissions as read only.
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
analysis:
|
|
||||||
name: Scorecard analysis
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
# Needed to upload the results to code-scanning dashboard.
|
|
||||||
security-events: write
|
|
||||||
# Needed to publish results and get a badge (see publish_results below).
|
|
||||||
id-token: write
|
|
||||||
contents: read
|
|
||||||
actions: read
|
|
||||||
# To allow GraphQL ListCommits to work
|
|
||||||
issues: read
|
|
||||||
pull-requests: read
|
|
||||||
# To detect SAST tools
|
|
||||||
checks: read
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
- name: "Checkout code"
|
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: "Run analysis"
|
|
||||||
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
|
|
||||||
with:
|
|
||||||
results_file: results.sarif
|
|
||||||
results_format: sarif
|
|
||||||
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
|
|
||||||
# - you want to enable the Branch-Protection check on a *public* repository, or
|
|
||||||
# - you are installing Scorecards on a *private* repository
|
|
||||||
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
|
|
||||||
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
|
|
||||||
|
|
||||||
# Public repositories:
|
|
||||||
# - Publish results to OpenSSF REST API for easy access by consumers
|
|
||||||
# - Allows the repository to include the Scorecard badge.
|
|
||||||
# - See https://github.com/ossf/scorecard-action#publishing-results.
|
|
||||||
# For private repositories:
|
|
||||||
# - `publish_results` will always be set to `false`, regardless
|
|
||||||
# of the value entered here.
|
|
||||||
publish_results: true
|
|
||||||
|
|
||||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
|
||||||
# format to the repository Actions tab.
|
|
||||||
- name: "Upload artifact"
|
|
||||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
||||||
with:
|
|
||||||
name: SARIF file
|
|
||||||
path: results.sarif
|
|
||||||
retention-days: 5
|
|
||||||
|
|
||||||
# Upload the results to GitHub's code scanning dashboard.
|
|
||||||
- name: "Upload to code-scanning"
|
|
||||||
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
|
|
||||||
with:
|
|
||||||
sarif_file: results.sarif
|
|
||||||
232
.github/workflows/sub_buildPixi.yml
vendored
232
.github/workflows/sub_buildPixi.yml
vendored
@@ -1,232 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2024 0penBrain, Lorenz Lechner and Jacob Oursland. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
# This is a build and test workflow for CI of FreeCAD.
|
|
||||||
# This workflow aims at building and testing FreeCAD on a Conda environment on macOS.
|
|
||||||
|
|
||||||
name: Pixi Builds
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
artifactBasename:
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
testOnBuildDir:
|
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
allowedToFail:
|
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
outputs:
|
|
||||||
reportFile:
|
|
||||||
value: ${{ jobs.Build.outputs.reportFile }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build_with_pixi:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
continue-on-error: ${{ inputs.allowedToFail }}
|
|
||||||
env:
|
|
||||||
CCACHE_COMPRESS: true
|
|
||||||
CCACHE_COMPRESSLEVEL: 5
|
|
||||||
CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache/config
|
|
||||||
CCACHE_DIR: ${{ github.workspace }}/ccache
|
|
||||||
CCACHE_MAXSIZE: 1G
|
|
||||||
CCACHE_NODIRECT: true
|
|
||||||
CCACHE_NOHASHDIR: true
|
|
||||||
CCACHE_NOINODECACHE: true
|
|
||||||
CCACHE_SLOPPINESS: "include_file_ctime,include_file_mtime,pch_defines,time_macros"
|
|
||||||
builddir: ${{ github.workspace }}/build/release/
|
|
||||||
cacheKey: pixi-${{ matrix.os }}
|
|
||||||
config: release
|
|
||||||
logdir: ${{ github.workspace }}/logs/
|
|
||||||
reportdir: ${{ github.workspace }}/report/
|
|
||||||
reportfilename: ${{ inputs.artifactBasename }}-${{ matrix.os }}-report.md
|
|
||||||
outputs:
|
|
||||||
reportFile: ${{ steps.Init.outputs.reportFile }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
max-parallel: 6
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
- name: Set Platform Environment Variables
|
|
||||||
shell: bash -l {0}
|
|
||||||
env:
|
|
||||||
OPERATING_SYSTEM: ${{ runner.os }}
|
|
||||||
run: |
|
|
||||||
if [[ $OPERATING_SYSTEM == 'Windows' ]]; then
|
|
||||||
echo 'CCACHE_COMPILERCHECK=%compiler%' >> "$GITHUB_ENV"
|
|
||||||
else
|
|
||||||
echo 'CCACHE_COMPILERCHECK=%compiler% -dumpfullversion -dumpversion' >> "$GITHUB_ENV"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
|
|
||||||
- name: Add GCC Problem Matcher
|
|
||||||
if: runner.os == 'Linux'
|
|
||||||
run: |
|
|
||||||
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/gcc.json"
|
|
||||||
|
|
||||||
- name: Add Clang Problem Matcher
|
|
||||||
if: runner.os == 'macOS'
|
|
||||||
run: |
|
|
||||||
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/clang.json"
|
|
||||||
|
|
||||||
- name: Add MSVC++ Problem Matcher
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
run: |
|
|
||||||
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/msvc.json"
|
|
||||||
|
|
||||||
- name: Make needed directories, files and initializations
|
|
||||||
id: Init
|
|
||||||
run: |
|
|
||||||
mkdir -p ${{ env.builddir }}
|
|
||||||
mkdir -p ${{ env.logdir }}
|
|
||||||
mkdir -p ${{ env.reportdir }}
|
|
||||||
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
|
|
||||||
with:
|
|
||||||
pixi-version: v0.59.0
|
|
||||||
cache: false
|
|
||||||
|
|
||||||
- name: Restore Compiler Cache
|
|
||||||
id: cache-restore
|
|
||||||
if: always()
|
|
||||||
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
|
||||||
with:
|
|
||||||
path: ${{ env.CCACHE_DIR }}
|
|
||||||
key: FC-${{ env.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
|
|
||||||
restore-keys: |
|
|
||||||
FC-${{ env.cacheKey }}-${{ github.ref }}-
|
|
||||||
FC-${{ env.cacheKey }}-
|
|
||||||
|
|
||||||
- name: Print CCache statistics before build, reset stats and print config
|
|
||||||
run: |
|
|
||||||
pixi run ccache -s
|
|
||||||
pixi run ccache -z
|
|
||||||
pixi run ccache -p
|
|
||||||
|
|
||||||
- name: CMake Configure
|
|
||||||
run: |
|
|
||||||
pixi run configure-${{ env.config }}
|
|
||||||
|
|
||||||
- name: CMake Build
|
|
||||||
run: |
|
|
||||||
pixi run build-${{ env.config }}
|
|
||||||
|
|
||||||
- name: Print ccache statistics after Build
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
pixi run ccache -s
|
|
||||||
|
|
||||||
- name: FreeCAD CLI tests on build dir
|
|
||||||
if: inputs.testOnBuildDir
|
|
||||||
timeout-minutes: 10
|
|
||||||
uses: ./.github/workflows/actions/runPythonTests
|
|
||||||
with:
|
|
||||||
testDescription: "CLI tests on build dir"
|
|
||||||
testCommand: pixi run ${{ env.builddir }}/bin/FreeCADCmd -t 0
|
|
||||||
logFile: ${{ env.logdir }}TestCLIBuild.log
|
|
||||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
|
|
||||||
- name: FreeCAD GUI tests on build dir
|
|
||||||
if: runner.os == 'Linux' && inputs.testOnBuildDir
|
|
||||||
timeout-minutes: 15
|
|
||||||
uses: ./.github/workflows/actions/runPythonTests
|
|
||||||
with:
|
|
||||||
testDescription: "GUI tests on build dir"
|
|
||||||
testCommand: pixi run xvfb-run ${{ env.builddir }}/bin/FreeCAD -t 0
|
|
||||||
logFile: ${{ env.logdir }}TestGUIBuild.log
|
|
||||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
|
|
||||||
- name: C++ tests
|
|
||||||
timeout-minutes: 10
|
|
||||||
if: runner.os != 'Windows'
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runAllTests
|
|
||||||
with:
|
|
||||||
reportdir: ${{ env.reportdir }}
|
|
||||||
builddir: ${{ env.builddir }}
|
|
||||||
reportFile: ${{ env.reportdir }}${{ env.reportfilename }}
|
|
||||||
|
|
||||||
- name: CMake Install
|
|
||||||
run: |
|
|
||||||
pixi run install-${{ env.config }}
|
|
||||||
|
|
||||||
- name: FreeCAD CLI tests on install
|
|
||||||
if: runner.os != 'Windows'
|
|
||||||
timeout-minutes: 10
|
|
||||||
uses: ./.github/workflows/actions/runPythonTests
|
|
||||||
with:
|
|
||||||
testDescription: "CLI tests on install"
|
|
||||||
testCommand: pixi run FreeCADCmd -t 0
|
|
||||||
logFile: ${{ env.logdir }}TestCLIInstall.log
|
|
||||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
|
|
||||||
- name: FreeCAD GUI tests on install
|
|
||||||
# if: runner.os == 'Linux'
|
|
||||||
# currently broken on Qt6 builds
|
|
||||||
if: false
|
|
||||||
timeout-minutes: 15
|
|
||||||
uses: ./.github/workflows/actions/runPythonTests
|
|
||||||
with:
|
|
||||||
testDescription: "GUI tests on install"
|
|
||||||
testCommand: pixi run xvfb-run FreeCAD -t 0
|
|
||||||
logFile: ${{ env.logdir }}TestGUIInstall.log
|
|
||||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
|
|
||||||
- name: Save Compiler Cache
|
|
||||||
id: cache-save
|
|
||||||
if: always()
|
|
||||||
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
|
||||||
with:
|
|
||||||
path: ${{ env.CCACHE_DIR }}
|
|
||||||
key: FC-${{ env.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
|
|
||||||
|
|
||||||
- name: Upload logs
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
||||||
with:
|
|
||||||
name: ${{ inputs.artifactBasename }}-${{ matrix.os }}-Logs
|
|
||||||
path: |
|
|
||||||
${{ env.logdir }}
|
|
||||||
/var/crash/*FreeCAD*
|
|
||||||
|
|
||||||
- name: Upload report
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
||||||
with:
|
|
||||||
name: ${{ env.reportfilename }}
|
|
||||||
path: |
|
|
||||||
${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
239
.github/workflows/sub_buildUbuntu.yml
vendored
239
.github/workflows/sub_buildUbuntu.yml
vendored
@@ -1,239 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
# This is a build and test workflow for CI of FreeCAD.
|
|
||||||
# This workflow aims at building and testing FreeCAD on Ubuntu 24.04 using GCC.
|
|
||||||
|
|
||||||
name: Build Ubuntu 24.04
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
artifactBasename:
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
testOnBuildDir:
|
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
allowedToFail:
|
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
outputs:
|
|
||||||
reportFile:
|
|
||||||
value: ${{ jobs.Build.outputs.reportFile }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
Build:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
continue-on-error: ${{ inputs.allowedToFail }}
|
|
||||||
env:
|
|
||||||
CCACHE_COMPILERCHECK: "%compiler% -dumpfullversion -dumpversion" # default:mtime
|
|
||||||
CCACHE_COMPRESS: true
|
|
||||||
CCACHE_COMPRESSLEVEL: 5
|
|
||||||
CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache/config
|
|
||||||
CCACHE_DIR: ${{ github.workspace }}/ccache
|
|
||||||
CCACHE_MAXSIZE: 1G
|
|
||||||
CCACHE_NODIRECT: true
|
|
||||||
CCACHE_NOHASHDIR: true
|
|
||||||
CCACHE_NOINODECACHE: true
|
|
||||||
CCACHE_SLOPPINESS: "include_file_ctime,include_file_mtime,pch_defines,time_macros"
|
|
||||||
CC: /usr/bin/gcc
|
|
||||||
CXX: /usr/bin/g++
|
|
||||||
#CC: /usr/bin/clang
|
|
||||||
#CXX: /usr/bin/clang++
|
|
||||||
builddir: ${{ github.workspace }}/build/release/
|
|
||||||
config: release
|
|
||||||
logdir: /tmp/logs/
|
|
||||||
reportdir: /tmp/report/
|
|
||||||
reportfilename: ${{ inputs.artifactBasename }}-report.md
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
outputs:
|
|
||||||
reportFile: ${{ steps.Init.outputs.reportFile }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
- name: Checking out source code
|
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Install FreeCAD dependencies
|
|
||||||
run: ./package/ubuntu/install-apt-packages.sh
|
|
||||||
|
|
||||||
- name: Install FreeCAD Python test dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt-get update -y -qq
|
|
||||||
sudo apt-get install -y -qq python3-pip
|
|
||||||
python3 -m pip install --upgrade pip
|
|
||||||
python3 -m pip install ifcopenshell==0.8.2 --break-system-packages
|
|
||||||
|
|
||||||
- name: Make needed directories, files and initializations
|
|
||||||
id: Init
|
|
||||||
run: |
|
|
||||||
mkdir -p ${{ env.CCACHE_DIR }}
|
|
||||||
mkdir -p ${{ env.CCACHE_CONFIGPATH }}
|
|
||||||
mkdir -p ${{ env.builddir }}
|
|
||||||
mkdir -p ${{ env.logdir }}
|
|
||||||
mkdir -p ${{ env.reportdir }}
|
|
||||||
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Generate cache key
|
|
||||||
id: genCacheKey
|
|
||||||
uses: ./.github/workflows/actions/linux/generateCacheKey
|
|
||||||
with:
|
|
||||||
compiler: ${{ env.CXX }}
|
|
||||||
qt_major_version: 5
|
|
||||||
|
|
||||||
- name: Restore Compiler Cache
|
|
||||||
id: cache-restore
|
|
||||||
if: always()
|
|
||||||
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
|
||||||
with:
|
|
||||||
path: ${{ env.CCACHE_DIR }}
|
|
||||||
key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
|
|
||||||
restore-keys: |
|
|
||||||
FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-
|
|
||||||
FC-${{ steps.genCacheKey.outputs.cacheKey }}-
|
|
||||||
|
|
||||||
- name: Print CCache statistics before build, reset stats and print config
|
|
||||||
run: |
|
|
||||||
ccache -s
|
|
||||||
ccache -z
|
|
||||||
ccache -p
|
|
||||||
|
|
||||||
- name: Install cmake
|
|
||||||
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be # v2.0.2
|
|
||||||
with:
|
|
||||||
cmake-version: '3.31.6'
|
|
||||||
|
|
||||||
- name: CMake Configure
|
|
||||||
uses: ./.github/workflows/actions/linux/configure
|
|
||||||
with:
|
|
||||||
extraParameters: -G Ninja --preset ${{ env.config }}
|
|
||||||
builddir: ${{ env.builddir }}
|
|
||||||
logFile: ${{ env.logdir }}Cmake.log
|
|
||||||
errorFile: ${{ env.logdir }}CmakeErrors.log
|
|
||||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
|
|
||||||
- name: CMake Build
|
|
||||||
uses: ./.github/workflows/actions/linux/build
|
|
||||||
with:
|
|
||||||
builddir: ${{ env.builddir }}
|
|
||||||
logFile: ${{ env.logdir }}Build.log
|
|
||||||
errorFile: ${{ env.logdir }}BuildErrors.log
|
|
||||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
|
|
||||||
- name: Print ccache statistics after Build
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
ccache -s
|
|
||||||
|
|
||||||
- name: FreeCAD CLI tests on build dir
|
|
||||||
if: inputs.testOnBuildDir
|
|
||||||
timeout-minutes: 10
|
|
||||||
uses: ./.github/workflows/actions/runPythonTests
|
|
||||||
with:
|
|
||||||
testDescription: "CLI tests on build dir"
|
|
||||||
testCommand: ${{ env.builddir }}/bin/FreeCADCmd -t 0
|
|
||||||
logFile: ${{ env.logdir }}TestCLIBuild.log
|
|
||||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
|
|
||||||
- name: FreeCAD GUI tests on build dir
|
|
||||||
if: inputs.testOnBuildDir
|
|
||||||
timeout-minutes: 15
|
|
||||||
uses: ./.github/workflows/actions/runPythonTests
|
|
||||||
with:
|
|
||||||
testDescription: "GUI tests on build dir"
|
|
||||||
# Use Python wrapper to run only GUI-registered tests with the built FreeCAD executable
|
|
||||||
testCommand: xvfb-run python3 ./.github/scripts/run_gui_tests.py "${{ env.builddir }}"
|
|
||||||
logFile: ${{ env.logdir }}TestGUIBuild.log
|
|
||||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
|
|
||||||
- name: C++ tests
|
|
||||||
timeout-minutes: 1
|
|
||||||
uses: ./.github/workflows/actions/runCPPTests/runAllTests
|
|
||||||
with:
|
|
||||||
reportdir: ${{ env.reportdir }}
|
|
||||||
builddir: ${{ env.builddir }}
|
|
||||||
reportFile: ${{ env.reportdir }}${{ env.reportfilename }}
|
|
||||||
|
|
||||||
- name: CMake Install
|
|
||||||
uses: ./.github/workflows/actions/linux/install
|
|
||||||
with:
|
|
||||||
builddir: ${{ env.builddir }}
|
|
||||||
logFile: ${{ env.logdir }}Install.log
|
|
||||||
errorFile: ${{ env.logdir }}InstallErrors.log
|
|
||||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
|
|
||||||
- name: FreeCAD CLI tests on install
|
|
||||||
timeout-minutes: 10
|
|
||||||
uses: ./.github/workflows/actions/runPythonTests
|
|
||||||
with:
|
|
||||||
testDescription: "CLI tests on install"
|
|
||||||
testCommand: FreeCADCmd -t 0
|
|
||||||
logFile: ${{ env.logdir }}TestCLIInstall.log
|
|
||||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
|
|
||||||
- name: FreeCAD GUI tests on install
|
|
||||||
timeout-minutes: 15
|
|
||||||
uses: ./.github/workflows/actions/runPythonTests
|
|
||||||
with:
|
|
||||||
testDescription: "GUI tests on install"
|
|
||||||
# Use Python wrapper to run only GUI-registered tests using the installed FreeCAD
|
|
||||||
testCommand: xvfb-run python3 ./.github/scripts/run_gui_tests.py "FreeCAD"
|
|
||||||
logFile: ${{ env.logdir }}TestGUIInstall.log
|
|
||||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
|
|
||||||
- name: Save Compiler Cache
|
|
||||||
id: cache-save
|
|
||||||
if: always()
|
|
||||||
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
|
||||||
with:
|
|
||||||
path: ${{ env.CCACHE_DIR }}
|
|
||||||
key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
|
|
||||||
|
|
||||||
- name: Upload logs
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
||||||
with:
|
|
||||||
name: ${{ inputs.artifactBasename }}-Logs
|
|
||||||
path: |
|
|
||||||
${{ env.logdir }}
|
|
||||||
/var/crash/*FreeCAD*
|
|
||||||
|
|
||||||
- name: Upload report
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
||||||
with:
|
|
||||||
name: ${{ env.reportfilename }}
|
|
||||||
path: |
|
|
||||||
${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
171
.github/workflows/sub_buildWindows.yml
vendored
171
.github/workflows/sub_buildWindows.yml
vendored
@@ -1,171 +0,0 @@
|
|||||||
# ***************************************************************************
|
|
||||||
# * Copyright (c) 2023 0penBrain *
|
|
||||||
# * *
|
|
||||||
# * This program is free software; you can redistribute it and/or modify *
|
|
||||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
|
||||||
# * as published by the Free Software Foundation; either version 2 of *
|
|
||||||
# * the License, or (at your option) any later version. *
|
|
||||||
# * for detail see the LICENCE text file. *
|
|
||||||
# * *
|
|
||||||
# * This program is distributed in the hope that it will be useful, *
|
|
||||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
||||||
# * GNU Library General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Library General Public *
|
|
||||||
# * License along with this program; if not, write to the Free Software *
|
|
||||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
|
||||||
# * USA *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
# This is a build and test workflow for CI of FreeCAD.
|
|
||||||
# This workflow aims at building and testing FreeCAD on Windows using MSVC.
|
|
||||||
|
|
||||||
name: Build Windows
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
artifactBasename:
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
allowedToFail:
|
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
outputs:
|
|
||||||
reportFile:
|
|
||||||
value: ${{ jobs.Build.outputs.reportFile }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
Build:
|
|
||||||
runs-on: windows-latest
|
|
||||||
continue-on-error: ${{ inputs.allowedToFail }}
|
|
||||||
env:
|
|
||||||
CCACHE_COMPILERCHECK: "%compiler%" # default:mtime
|
|
||||||
CCACHE_COMPRESS: true
|
|
||||||
CCACHE_COMPRESSLEVEL: 5
|
|
||||||
CCACHE_DIR: C:/FC/cache/
|
|
||||||
CCACHE_LOGFILE: C:/logs/ccache.log
|
|
||||||
CCACHE_MAXSIZE: 1G
|
|
||||||
CCACHE_NODIRECT: true
|
|
||||||
CCACHE_NOHASHDIR: true
|
|
||||||
CCACHE_NOINODECACHE: true
|
|
||||||
CCACHE_SLOPPINESS: "include_file_ctime,include_file_mtime,pch_defines,time_macros" # Can't get PCH to work on Windows
|
|
||||||
## Have to use C:\ because not enough space on workspace drive
|
|
||||||
builddir: C:/FC/build/release/
|
|
||||||
cacheKey: Windows
|
|
||||||
ccachebindir: C:/FC/ccache/
|
|
||||||
config: release
|
|
||||||
libpackdir: C:/FC/libpack/
|
|
||||||
logdir: C:/logs/
|
|
||||||
reportdir: C:/report/
|
|
||||||
reportfilename: ${{ inputs.artifactBasename }}-report.md
|
|
||||||
outputs:
|
|
||||||
reportFile: ${{ steps.Init.outputs.reportFile }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
- name: Checking out source code
|
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Make needed directories, files and initializations
|
|
||||||
id: Init
|
|
||||||
run: |
|
|
||||||
mkdir ${{ env.CCACHE_DIR }}
|
|
||||||
mkdir ${{ env.ccachebindir }}
|
|
||||||
mkdir ${{ env.libpackdir }}
|
|
||||||
mkdir ${{ env.builddir }}
|
|
||||||
mkdir ${{ env.logdir }}
|
|
||||||
mkdir ${{ env.reportdir }}
|
|
||||||
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Get Ccache
|
|
||||||
uses: ./.github/workflows/actions/windows/getCcache
|
|
||||||
with:
|
|
||||||
ccachebindir: ${{ env.ccachebindir }}
|
|
||||||
|
|
||||||
- name: Get Libpack
|
|
||||||
uses: ./.github/workflows/actions/windows/getLibpack
|
|
||||||
with:
|
|
||||||
libpackdir: ${{ env.libpackdir }}
|
|
||||||
|
|
||||||
- name: Restore compiler cache
|
|
||||||
id: cache-restore
|
|
||||||
if: always()
|
|
||||||
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
|
||||||
with:
|
|
||||||
path: ${{ env.CCACHE_DIR }}
|
|
||||||
key: FC-${{ env.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
|
|
||||||
restore-keys: |
|
|
||||||
FC-${{ env.cacheKey }}-${{ github.ref }}-
|
|
||||||
FC-${{ env.cacheKey }}-
|
|
||||||
|
|
||||||
- name: Print Ccache statistics before build, reset stats and print config
|
|
||||||
run: |
|
|
||||||
. $env:ccachebindir\ccache -s
|
|
||||||
. $env:ccachebindir\ccache -z
|
|
||||||
. $env:ccachebindir\ccache -p
|
|
||||||
|
|
||||||
- name: Install cmake
|
|
||||||
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be # v2.0.2
|
|
||||||
with:
|
|
||||||
cmake-version: '3.31.6'
|
|
||||||
|
|
||||||
- name: Configuring CMake
|
|
||||||
run: >
|
|
||||||
cmake -B"${{ env.builddir }}" .
|
|
||||||
--preset ${{ env.config }}
|
|
||||||
-DCMAKE_VS_NO_COMPILE_BATCHING=ON
|
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
|
||||||
-DFREECAD_USE_PCH=OFF
|
|
||||||
-DFREECAD_RELEASE_PDB=OFF
|
|
||||||
-DFREECAD_LIBPACK_DIR="${{ env.libpackdir }}"
|
|
||||||
-DFREECAD_COPY_DEPEND_DIRS_TO_BUILD=ON
|
|
||||||
-DFREECAD_COPY_LIBPACK_BIN_TO_BUILD=ON
|
|
||||||
-DFREECAD_COPY_PLUGINS_BIN_TO_BUILD=ON
|
|
||||||
|
|
||||||
- name: Add msbuild to PATH
|
|
||||||
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0
|
|
||||||
|
|
||||||
- name: Compiling sources
|
|
||||||
run: |
|
|
||||||
cd $env:builddir
|
|
||||||
msbuild ALL_BUILD.vcxproj /m /p:Configuration=Release /p:TrackFileAccess=false /p:CLToolPath=${{ env.ccachebindir }}
|
|
||||||
|
|
||||||
- name: Print Ccache statistics after build
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
. $env:ccachebindir\ccache -s
|
|
||||||
|
|
||||||
- name: C++ unit tests
|
|
||||||
if: false # Disabled because seems to not function on Windows build
|
|
||||||
timeout-minutes: 1
|
|
||||||
run: |
|
|
||||||
. ${{ env.builddir }}\tests\Release\Tests_run --gtest_output=json:${{ env.reportdir }}gtest_results.json # 2>&1 | tee -filepath ${{ env.logdir }}\unitTests.log
|
|
||||||
|
|
||||||
- name: FreeCAD CLI tests
|
|
||||||
run: |
|
|
||||||
. ${{ env.builddir }}\bin\FreeCADCmd -t 0 # 2>&1 | tee -filepath ${{ env.logdir }}\integrationTests.log
|
|
||||||
|
|
||||||
- name: Save Compiler Cache
|
|
||||||
id: cache-save
|
|
||||||
if: always()
|
|
||||||
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
|
||||||
with:
|
|
||||||
path: ${{ env.CCACHE_DIR }}
|
|
||||||
key: FC-${{ env.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
|
|
||||||
|
|
||||||
- name: Upload logs
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
||||||
with:
|
|
||||||
name: ${{ inputs.artifactBasename }}-Logs
|
|
||||||
path: |
|
|
||||||
${{ env.logdir }}
|
|
||||||
371
.github/workflows/sub_lint.yml
vendored
371
.github/workflows/sub_lint.yml
vendored
@@ -1,371 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
# This is the lint workflow for CI of FreeCAD
|
|
||||||
|
|
||||||
name: Lint
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
artifactBasename:
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
changedFiles:
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
changedLines:
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
changedCppFiles:
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
changedCppLines:
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
changedPythonFiles:
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
changedPythonLines:
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
checkLineendings:
|
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
lineendingsFailSilent:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
checkWhitespace:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
whitespaceFailSilent:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
checkTabs:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
tabsFailSilent:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
checkQtConnections:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
qtConnectionsFailSilent:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
checkCpplint:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
cpplintFailSilent:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
checkPylint:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
pylintDisable:
|
|
||||||
default: C0302,C0303 # Trailing whitespaces (C0303) are already checked
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
pylintFailSilent:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
checkBlack:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
blackFailSilent:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
checkClangFormat:
|
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
clangStyle:
|
|
||||||
default: file # for .clang-format file
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
clangFormatFailSilent:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
checkSpelling:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
listIgnoredMisspelling:
|
|
||||||
default: .github/codespellignore
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
spellingIgnore:
|
|
||||||
default: ./.git*,*.po,*.ts,*.svg,./src/3rdParty,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL*,./src/Doc/FreeCAD.uml,./build/
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
codespellFailSilent:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
checkClangTidy:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
clangTidyFailSilent:
|
|
||||||
default: true # warnings or notes will never fail the CI, only errors
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
checkClazy: # for the Message codes see: https://invent.kde.org/sdk/clazy#list-of-checks
|
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
clazyChecks:
|
|
||||||
default: level2,no-non-pod-global-static,no-copyable-polymorphic
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
clazyFailSilent:
|
|
||||||
default: true # warnings or notes will never fail the CI, only errors
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
checkClazyQT6:
|
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
clazyQT6Checks:
|
|
||||||
default: qt6-deprecated-api-fixes,qt6-header-fixes,qt6-qhash-signature,qt6-fwd-fixes,missing-qobject-macro # for QT6 Porting https://invent.kde.org/sdk/clazy#list-of-checks
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
QT6Branch: # branch to check for QT6 Porting
|
|
||||||
default: main
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
clazyQT6FailSilent:
|
|
||||||
default: true # warnings or notes will never fail the CI, only errors
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
outputs:
|
|
||||||
reportFile:
|
|
||||||
value: ${{ jobs.Lint.outputs.reportFile }}
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
Lint:
|
|
||||||
if: inputs.changedFiles != ''
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
logdir: /tmp/logs/
|
|
||||||
fixesdir: /tmp/fixes/
|
|
||||||
reportdir: /tmp/report/
|
|
||||||
reportfilename: ${{ inputs.artifactBasename }}-report.md
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
outputs:
|
|
||||||
reportFile: ${{ steps.Init.outputs.reportFile }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
- name: Check out code
|
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Make needed directories, files and initializations
|
|
||||||
id: Init
|
|
||||||
run: |
|
|
||||||
mkdir -p ${{ env.logdir }}
|
|
||||||
mkdir -p ${{ env.fixesdir }}
|
|
||||||
mkdir -p ${{ env.reportdir }}
|
|
||||||
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# Generic lints steps
|
|
||||||
- name: Check File Case Sensitivity
|
|
||||||
uses: credfeto/action-case-checker@cb652aeab29ed363bbdb7d9ee1bfcc010c46cac5 # v1.3.0
|
|
||||||
|
|
||||||
- name: Check for non Unix line ending
|
|
||||||
if: inputs.checkLineendings && always()
|
|
||||||
continue-on-error: ${{ inputs.lineendingsFailSilent }}
|
|
||||||
run: |
|
|
||||||
python3 tools/lint/generic_checks.py \
|
|
||||||
--lineendings-check \
|
|
||||||
--files "${{ inputs.changedFiles }}" \
|
|
||||||
--report-file "${{ env.reportdir }}${{ env.reportfilename }}" \
|
|
||||||
--log-dir "${{ env.logdir }}"
|
|
||||||
|
|
||||||
- name: Check for trailing whitespaces
|
|
||||||
if: inputs.checkWhitespace && always()
|
|
||||||
continue-on-error: ${{ inputs.whitespaceFailSilent }}
|
|
||||||
run: |
|
|
||||||
python3 tools/lint/generic_checks.py \
|
|
||||||
--whitespace-check \
|
|
||||||
--files "${{ inputs.changedFiles }}" \
|
|
||||||
--report-file "${{ env.reportdir }}${{ env.reportfilename }}" \
|
|
||||||
--log-dir "${{ env.logdir }}"
|
|
||||||
|
|
||||||
- name: Check for Tab usage
|
|
||||||
if: inputs.checkTabs && always()
|
|
||||||
continue-on-error: ${{ inputs.tabsFailSilent }}
|
|
||||||
run: |
|
|
||||||
python3 tools/lint/generic_checks.py \
|
|
||||||
--tabs-check \
|
|
||||||
--files "${{ inputs.changedFiles }}" \
|
|
||||||
--report-file "${{ env.reportdir }}${{ env.reportfilename }}" \
|
|
||||||
--log-dir "${{ env.logdir }}"
|
|
||||||
|
|
||||||
# Python linting steps
|
|
||||||
|
|
||||||
- name: Pylint
|
|
||||||
if: inputs.checkPylint && inputs.changedPythonFiles != '' && always()
|
|
||||||
continue-on-error: ${{ inputs.pylintFailSilent }}
|
|
||||||
run: |
|
|
||||||
python3 tools/lint/pylint.py \
|
|
||||||
--files "${{ inputs.changedPythonFiles }}" \
|
|
||||||
--disable "${{ inputs.pylintDisable }}" \
|
|
||||||
--log-dir "${{ env.logdir }}" \
|
|
||||||
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
|
|
||||||
|
|
||||||
- name: Black
|
|
||||||
if: inputs.checkBlack && inputs.changedPythonFiles != '' && always()
|
|
||||||
continue-on-error: ${{ inputs.blackFailSilent }}
|
|
||||||
run: |
|
|
||||||
python3 tools/lint/black.py \
|
|
||||||
--files "${{ inputs.changedPythonFiles }}" \
|
|
||||||
--log-dir "${{ env.logdir }}" \
|
|
||||||
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
|
|
||||||
|
|
||||||
# C++ linting steps
|
|
||||||
|
|
||||||
- name: Install FreeCAD dependencies
|
|
||||||
if: inputs.changedCppFiles != '' && always()
|
|
||||||
run: ./package/ubuntu/install-apt-packages.sh
|
|
||||||
|
|
||||||
- name: Run CMake # This is needed for Clang tools to work correctly
|
|
||||||
if: inputs.changedCppFiles != '' && always()
|
|
||||||
run: |
|
|
||||||
mkdir build && cmake -S ./ -B ./build/ -D CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE
|
|
||||||
|
|
||||||
- name: Check old Qt string-based connections (https://wiki.qt.io/New_Signal_Slot_Syntax)
|
|
||||||
if: inputs.checkQtConnections && inputs.changedCppFiles != '' && always()
|
|
||||||
continue-on-error: ${{ inputs.qtConnectionsFailSilent }}
|
|
||||||
run: |
|
|
||||||
python3 tools/lint/qt_connections.py \
|
|
||||||
--files "${{ inputs.changedFiles }}" \
|
|
||||||
--log-dir "${{ env.logdir }}" \
|
|
||||||
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
|
|
||||||
|
|
||||||
- name: Cpplint
|
|
||||||
if: inputs.checkCpplint && inputs.changedCppFiles != '' && always()
|
|
||||||
continue-on-error: ${{ inputs.cpplintFailSilent }}
|
|
||||||
run: |
|
|
||||||
python3 tools/lint/cpplint.py \
|
|
||||||
--files "${{ inputs.changedCppFiles }}" \
|
|
||||||
--log-dir "${{ env.logdir }}" \
|
|
||||||
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
|
|
||||||
|
|
||||||
- name: Clang-format
|
|
||||||
if: inputs.checkClangFormat && inputs.changedCppFiles != '' && always()
|
|
||||||
continue-on-error: ${{ inputs.clangFormatFailSilent }}
|
|
||||||
run: |
|
|
||||||
python3 tools/lint/clang_format.py \
|
|
||||||
--files "${{ inputs.changedCppFiles }}" \
|
|
||||||
--clang-style "${{ inputs.clangStyle }}" \
|
|
||||||
--log-dir "${{ env.logdir }}" \
|
|
||||||
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
|
|
||||||
|
|
||||||
- name: Codespell
|
|
||||||
if: inputs.checkSpelling && always()
|
|
||||||
continue-on-error: ${{ inputs.codespellFailSilent }}
|
|
||||||
run: |
|
|
||||||
python3 tools/lint/codespell.py \
|
|
||||||
--files ${{ inputs.changedFiles }} \
|
|
||||||
--ignore-words "${{ inputs.listIgnoredMisspelling }}" \
|
|
||||||
--skip "${{ inputs.spellingIgnore }}" \
|
|
||||||
--log-dir "${{ env.logdir }}" \
|
|
||||||
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
|
|
||||||
|
|
||||||
- name: Clang-tidy
|
|
||||||
if: inputs.checkClangTidy && inputs.changedCppFiles != '' && always()
|
|
||||||
continue-on-error: ${{ inputs.clangTidyFailSilent }}
|
|
||||||
run: |
|
|
||||||
python3 tools/lint/clang_tidy.py \
|
|
||||||
--files "${{ inputs.changedCppFiles }}" \
|
|
||||||
--line-filter '${{ inputs.changedCppLines }}' \
|
|
||||||
--clang-style "${{ inputs.clangStyle }}" \
|
|
||||||
--log-dir "${{ env.logdir }}" \
|
|
||||||
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
|
|
||||||
|
|
||||||
- name: Clazy
|
|
||||||
if: inputs.checkClazy && inputs.changedCppFiles != '' && always()
|
|
||||||
continue-on-error: ${{ inputs.clazyFailSilent }}
|
|
||||||
run: |
|
|
||||||
python3 tools/lint/clazy.py \
|
|
||||||
--files "${{ inputs.changedCppFiles }}" \
|
|
||||||
--clazy-checks "${{ inputs.clazyChecks }}" \
|
|
||||||
--log-dir "${{ env.logdir }}" \
|
|
||||||
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
|
|
||||||
|
|
||||||
- name: Clazy-QT6
|
|
||||||
if: inputs.checkClazyQT6 && inputs.changedCppFiles != '' && github.ref == inputs.QT6Branch && always()
|
|
||||||
continue-on-error: ${{ inputs.clazyQT6FailSilent }}
|
|
||||||
run: |
|
|
||||||
python3 tools/lint/clazy_qt6.py \
|
|
||||||
--files "${{ inputs.changedCppFiles }}" \
|
|
||||||
--clazy-qt6-checks "${{ inputs.clazyQT6Checks }}" \
|
|
||||||
--log-dir "${{ env.logdir }}" \
|
|
||||||
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
|
|
||||||
|
|
||||||
# Upload steps
|
|
||||||
|
|
||||||
- name: Upload logs and fixes
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
||||||
with:
|
|
||||||
name: ${{ inputs.artifactBasename }}-Logs
|
|
||||||
path: |
|
|
||||||
${{ env.logdir }}
|
|
||||||
${{ env.fixesdir }}
|
|
||||||
|
|
||||||
- name: Upload report
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
||||||
with:
|
|
||||||
name: ${{ env.reportfilename }}
|
|
||||||
path: |
|
|
||||||
${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
194
.github/workflows/sub_prepare.yml
vendored
194
.github/workflows/sub_prepare.yml
vendored
@@ -1,194 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
# This is the pre-check workflow for CI of FreeCAD.
|
|
||||||
# It aims at running some basic checks about the workflow run ...
|
|
||||||
# ... and gathering some data needed for the next steps.
|
|
||||||
|
|
||||||
name: Prepare
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
artifactBasename:
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
dontFailOnOldRebase:
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
maxRebaseHours:
|
|
||||||
default: "48"
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
outputs:
|
|
||||||
reportFile:
|
|
||||||
value: ${{ jobs.Prepare.outputs.reportFile }}
|
|
||||||
changedFiles:
|
|
||||||
value: ${{ jobs.Prepare.outputs.changedFiles }}
|
|
||||||
changedLines:
|
|
||||||
value: ${{ jobs.Prepare.outputs.changedLines }}
|
|
||||||
changedPythonFiles:
|
|
||||||
value: ${{ jobs.Prepare.outputs.changedPythonFiles }}
|
|
||||||
changedPythonLines:
|
|
||||||
value: ${{ jobs.Prepare.outputs.changedPythonLines }}
|
|
||||||
changedCppFiles:
|
|
||||||
value: ${{ jobs.Prepare.outputs.changedCppFiles }}
|
|
||||||
changedCppLines:
|
|
||||||
value: ${{ jobs.Prepare.outputs.changedCppLines }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
Prepare:
|
|
||||||
env:
|
|
||||||
isPR: ${{ github.event_name == 'pull_request' }}
|
|
||||||
isPush: ${{ github.event_name == 'push' }}
|
|
||||||
logdir: /tmp/logs/
|
|
||||||
reportdir: /tmp/report/
|
|
||||||
reportfilename: ${{ inputs.artifactBasename }}-report.md
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
outputs:
|
|
||||||
reportFile: ${{ steps.Init.outputs.reportFile }}
|
|
||||||
changedFiles: ${{ steps.Output.outputs.changedFiles }}
|
|
||||||
changedLines: ${{ steps.Output.outputs.changedLines }}
|
|
||||||
changedPythonFiles: ${{ steps.Output.outputs.changedPythonFiles }}
|
|
||||||
changedPythonLines: ${{ steps.Output.outputs.changedPythonLines }}
|
|
||||||
changedCppFiles: ${{ steps.Output.outputs.changedCppFiles }}
|
|
||||||
changedCppLines: ${{ steps.Output.outputs.changedCppLines }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
- name: Make needed directories, files and initializations
|
|
||||||
id: Init
|
|
||||||
run: |
|
|
||||||
mkdir -p ${{ env.logdir }}
|
|
||||||
mkdir -p ${{ env.reportdir }}
|
|
||||||
commitCnt=0
|
|
||||||
touch ${{ env.logdir }}changedFiles.lst ${{ env.logdir }}changedCppFiles.lst ${{ env.logdir }}changedPythonFiles.lst
|
|
||||||
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
|
|
||||||
- name: Check out code
|
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
- name: Determine base and head SHA in case of PR
|
|
||||||
if: env.isPR == 'true'
|
|
||||||
run: |
|
|
||||||
baseSha=${{ github.event.pull_request.base.sha }}
|
|
||||||
headSha=${{ github.event.pull_request.head.sha }}
|
|
||||||
echo "baseSha=$baseSha" >> $GITHUB_ENV
|
|
||||||
echo "headSha=$headSha" >> $GITHUB_ENV
|
|
||||||
echo "This CI run is performed on a Pull Request" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
echo "Base SHA is $baseSha, Head SHA is $headSha" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
- name: Check if PR has been recently rebased
|
|
||||||
if: env.isPR == 'true'
|
|
||||||
continue-on-error: ${{ inputs.dontFailOnOldRebase }}
|
|
||||||
run: |
|
|
||||||
baseDate=$(curl -H "Accept: application/vnd.github+json" -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/commits/$baseSha | jq -r '.commit.committer.date')
|
|
||||||
dateDiff=$(( ( $(date +%s) - $(date -d $baseDate +%s) ) / 3600 ))
|
|
||||||
echo "Pull request is based on a $dateDiff hour-old commit" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
# Exit the step with appropriate code
|
|
||||||
if [ $dateDiff -gt ${{ inputs.maxRebaseHours }} ]
|
|
||||||
then
|
|
||||||
echo -n ":warning: Pull request should be rebased" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
- name: Determine base and head SHA in case of push
|
|
||||||
if: env.isPush == 'true'
|
|
||||||
run: |
|
|
||||||
baseSha=${{ github.event.before }}
|
|
||||||
headSha=${{ github.event.after }}
|
|
||||||
echo "headSha=$headSha" >> $GITHUB_ENV
|
|
||||||
if [ $baseSha -eq 0 ]
|
|
||||||
then
|
|
||||||
echo "This CI run is performed on a Push that created a new branch : files changed will be ignored" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
echo "Head SHA is $headSha" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
echo "isPush='false'" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "This CI run is performed on a Push" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
echo "Base SHA is $baseSha, Head SHA is $headSha" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
echo "baseSha=$baseSha" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
- name: Get compare between head and base
|
|
||||||
if: env.isPR == 'true' || env.isPush == 'true'
|
|
||||||
run: |
|
|
||||||
echo "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/compare/$baseSha...$headSha"
|
|
||||||
curl -H "Accept: application/vnd.github+json" -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/compare/$baseSha...$headSha > ${{ env.logdir }}compare.json
|
|
||||||
- name: Get number of commits in the changeset
|
|
||||||
if: env.isPR == 'true' || env.isPush == 'true'
|
|
||||||
run: |
|
|
||||||
commitCnt=$(jq -re '.ahead_by' ${{ env.logdir }}compare.json)
|
|
||||||
echo "Changeset is composed of $commitCnt commit(s)" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
- name: Get files modified in changeset #TODO check what happens with deleted file in the subsequent process
|
|
||||||
if: env.isPR == 'true'
|
|
||||||
env:
|
|
||||||
API_URL: ${{ github.api_url }}
|
|
||||||
TOKEN: ${{ github.token }}
|
|
||||||
REPO: ${{ github.repository }}
|
|
||||||
REF: ${{ github.ref_name }}
|
|
||||||
PR: ${{ github.event.number }}
|
|
||||||
run: |
|
|
||||||
# could reduce this to a single
|
|
||||||
python3 tools/lint/changed_lines.py --api-url ${API_URL} --token ${TOKEN} --repo ${REPO} --ref=${REF} --pr=${PR} > ${{ env.logdir }}changedLines.lst
|
|
||||||
cat ${{ env.logdir }}changedLines.lst | jq '.[].name' > ${{ env.logdir }}changedFiles.lst
|
|
||||||
python3 tools/lint/changed_lines.py --api-url ${API_URL} --token ${TOKEN} --repo ${REPO} --ref=${REF} --pr=${PR} --file-filter '.py, .pyi' > ${{ env.logdir }}changedPythonLines.lst
|
|
||||||
cat ${{ env.logdir }}changedPythonLines.lst | jq '.[].name' > ${{ env.logdir }}changedPythonFiles.lst
|
|
||||||
python3 tools/lint/changed_lines.py --api-url ${API_URL} --token ${TOKEN} --repo ${REPO} --ref=${REF} --pr=${PR} --file-filter '.c, .cc, .cu, .cuh, .c++, .cpp, .cxx, .h, .hh, .h++, .hpp, .hxx' > ${{ env.logdir }}changedCppLines.lst
|
|
||||||
cat ${{ env.logdir }}changedCppLines.lst | jq '.[].name' > ${{ env.logdir }}changedCppFiles.lst
|
|
||||||
|
|
||||||
# Write the report
|
|
||||||
echo "::group::Modified files in changeset (removed files are ignored) :" ; cat ${{ env.logdir }}changedFiles.lst ; echo "::endgroup::"
|
|
||||||
echo "<details><summary>Modified files (removed files are ignored):</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
cat ${{ env.logdir }}changedFiles.lst >> ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
- name: Transmitting outputs
|
|
||||||
id: Output
|
|
||||||
run: |
|
|
||||||
echo "changedFiles=$(cat ${{ env.logdir }}changedFiles.lst | tr '\n' ' ')" >> $GITHUB_OUTPUT
|
|
||||||
echo "changedLines=$(cat ${{ env.logdir }}changedLines.lst | tr '\n' ' ')" >> $GITHUB_OUTPUT
|
|
||||||
echo "changedPythonFiles=$(cat ${{ env.logdir }}changedPythonFiles.lst | tr '\n' ' ')" >> $GITHUB_OUTPUT
|
|
||||||
echo "changedPythonLines=$(cat ${{ env.logdir }}changedPythonLines.lst | tr '\n' ' ')" >> $GITHUB_OUTPUT
|
|
||||||
echo "changedCppFiles=$(cat ${{ env.logdir }}changedCppFiles.lst | tr '\n' ' ')" >> $GITHUB_OUTPUT
|
|
||||||
echo "changedCppLines=$(cat ${{ env.logdir }}changedCppLines.lst | tr '\n' ' ')" >> $GITHUB_OUTPUT
|
|
||||||
echo "" >> $GITHUB_OUTPUT
|
|
||||||
- name: Upload logs
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
||||||
with:
|
|
||||||
name: ${{ inputs.artifactBasename }}-Logs
|
|
||||||
path: |
|
|
||||||
${{ env.logdir }}
|
|
||||||
- name: Upload report
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
||||||
with:
|
|
||||||
name: ${{ env.reportfilename }}
|
|
||||||
path: |
|
|
||||||
${{env.reportdir}}${{ env.reportfilename }}
|
|
||||||
125
.github/workflows/sub_wrapup.yml
vendored
125
.github/workflows/sub_wrapup.yml
vendored
@@ -1,125 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
# ***************************************************************************
|
|
||||||
# * *
|
|
||||||
# * Copyright (c) 2023 0penBrain. *
|
|
||||||
# * *
|
|
||||||
# * This file is part of FreeCAD. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
|
||||||
# * under the terms of the GNU Lesser General Public License as *
|
|
||||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
|
||||||
# * License, or (at your option) any later version. *
|
|
||||||
# * *
|
|
||||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
|
||||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
# * Lesser General Public License for more details. *
|
|
||||||
# * *
|
|
||||||
# * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
# * License along with FreeCAD. If not, see *
|
|
||||||
# * <https://www.gnu.org/licenses/>. *
|
|
||||||
# * *
|
|
||||||
# ***************************************************************************
|
|
||||||
|
|
||||||
# This is a generic wrapup workflow that only aims at gathering reports and ...
|
|
||||||
# ... presenting them as a unified summary
|
|
||||||
#
|
|
||||||
# It expects steps to be summarized to be presented a JSON input formatted ...
|
|
||||||
# ... as the "needs" context of Github :
|
|
||||||
# https://docs.github.com/en/actions/learn-github-actions/contexts#needs-context
|
|
||||||
# In addition to standard "result", each step shall have a string entry in "outputs" ...
|
|
||||||
# ... named "reportFile" containing the name of the corresponding report. The ...
|
|
||||||
# ... report file shall be available in an artifact with the same name.
|
|
||||||
|
|
||||||
name: WrapUp
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
previousSteps:
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
WrapUp:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
artifactsDownloadDir: /tmp/artifacts/
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
|
||||||
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
|
||||||
with:
|
|
||||||
egress-policy: audit
|
|
||||||
|
|
||||||
- name: Make needed directories, files and initializations
|
|
||||||
run: |
|
|
||||||
mkdir -p ${{ env.artifactsDownloadDir }}
|
|
||||||
- name: Download artifacts
|
|
||||||
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
|
|
||||||
with:
|
|
||||||
path: ${{ env.artifactsDownloadDir }}
|
|
||||||
- name: Save input data to file
|
|
||||||
run: |
|
|
||||||
cat > data << "EOD"
|
|
||||||
${{ inputs.previousSteps }}
|
|
||||||
EOD
|
|
||||||
- name: Compute the report
|
|
||||||
run: |
|
|
||||||
echo "usedArtifacts<<EOD" >> $GITHUB_ENV
|
|
||||||
for step in $(jq -r "keys_unsorted | .[]" data)
|
|
||||||
do
|
|
||||||
echo "Processing step $step"
|
|
||||||
result=$(jq -r ".\"$step\".result" data)
|
|
||||||
icon=":heavy_check_mark:"
|
|
||||||
if [ $result == 'failure' ]
|
|
||||||
then
|
|
||||||
icon=":x:"
|
|
||||||
elif [ $result == 'cancelled' ]
|
|
||||||
then
|
|
||||||
icon=":no_entry_sign:"
|
|
||||||
elif [ $result == 'skipped' ]
|
|
||||||
then
|
|
||||||
icon=":white_check_mark:"
|
|
||||||
fi
|
|
||||||
echo "### $icon $step step" >> report.md
|
|
||||||
if [ $result == 'skipped' ]
|
|
||||||
then
|
|
||||||
echo "Step was skipped, no report was generated" | tee -a report.md
|
|
||||||
continue
|
|
||||||
elif [ $result == 'cancelled' ]
|
|
||||||
then
|
|
||||||
echo "Step was cancelled when executing, report may be incomplete" | tee -a report.md
|
|
||||||
fi
|
|
||||||
report=$(jq -r ".\"$step\".outputs.reportFile" data)
|
|
||||||
if [ $report ]
|
|
||||||
then
|
|
||||||
echo "Report for step $step is $report"
|
|
||||||
echo "$report" >> $GITHUB_ENV
|
|
||||||
if [ $(find ${{ env.artifactsDownloadDir }} -type f -name $report | wc -l) -eq 1 ]
|
|
||||||
then
|
|
||||||
find ${{ env.artifactsDownloadDir }} -type f -name $report -exec cat {} \; >> report.md
|
|
||||||
else
|
|
||||||
echo "No or several files found for report $report, not printing" | tee -a report.md
|
|
||||||
echo "Below files found :"
|
|
||||||
find ${{ env.artifactsDownloadDir }} -type f -name $report
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Report file was not set by step $step" | tee -a report.md
|
|
||||||
fi
|
|
||||||
echo "" >> report.md
|
|
||||||
done
|
|
||||||
echo "EOD" >> $GITHUB_ENV
|
|
||||||
cat report.md >> $GITHUB_STEP_SUMMARY
|
|
||||||
- name: Delete used artifacts
|
|
||||||
continue-on-error: true
|
|
||||||
uses: geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # v5.1.0
|
|
||||||
with:
|
|
||||||
name: |
|
|
||||||
${{ env.usedArtifacts }}
|
|
||||||
16
.github/workflows/weekly-build-notes.md
vendored
16
.github/workflows/weekly-build-notes.md
vendored
@@ -1,16 +0,0 @@
|
|||||||
> [!IMPORTANT]
|
|
||||||
> Bleeding edge FreeCAD development builds for testing bugfixes, regressions, and recently implemented features. Do not use in a production environment.
|
|
||||||
|
|
||||||
**Changes since last weekly:** <!--DIFF_LINK-->
|
|
||||||
|
|
||||||
### How-to use
|
|
||||||
|
|
||||||
1. Download the appropriate asset for your OS below
|
|
||||||
2. Unpack the bundle to any folder on your system
|
|
||||||
3. Launch the application
|
|
||||||
- **Windows**
|
|
||||||
Run `\FreeCAD.exe` in the extracted directory
|
|
||||||
- **macOS**
|
|
||||||
Launch `/FreeCAD.app` in the extracted directory
|
|
||||||
- **Linux**
|
|
||||||
Open the `*.AppImage`
|
|
||||||
140
.github/workflows/weekly-compare-link.yml
vendored
140
.github/workflows/weekly-compare-link.yml
vendored
@@ -1,140 +0,0 @@
|
|||||||
name: Weekly compare link to release notes
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published] # run automatically when a (pre-)release is published
|
|
||||||
workflow_dispatch: # allow manual runs too
|
|
||||||
inputs:
|
|
||||||
current_tag:
|
|
||||||
description: "Weekly tag (e.g., weekly-2026.01.07). Leave empty to auto-detect latest weekly pre-release."
|
|
||||||
required: false
|
|
||||||
dry_run:
|
|
||||||
description: "Only compute; do not update the release body."
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write # required to PATCH the release body
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-notes:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Inject compare link into weekly release notes
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
env:
|
|
||||||
# Pass manual inputs via env for convenience
|
|
||||||
CURRENT_TAG: ${{ github.event.inputs.current_tag }}
|
|
||||||
DRY_RUN: ${{ github.event.inputs.dry_run }}
|
|
||||||
PLACEHOLDER: "<!--DIFF_LINK-->"
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
// Updates the current weekly release notes with a compare link to the previous weekly.
|
|
||||||
// Works for both release-published events and manual (workflow_dispatch) runs.
|
|
||||||
const owner = context.repo.owner;
|
|
||||||
const repo = context.repo.repo;
|
|
||||||
|
|
||||||
const rx = /^weekly-(\d{4})\.(\d{2})\.(\d{2})$/;
|
|
||||||
|
|
||||||
// Determine currentTag:
|
|
||||||
// 1) Manual input via workflow_dispatch (env.CURRENT_TAG)
|
|
||||||
// 2) Tag from release event payload
|
|
||||||
// 3) Fallback: newest weekly pre-release
|
|
||||||
let currentTag = process.env.CURRENT_TAG || (context.payload?.release?.tag_name) || null;
|
|
||||||
|
|
||||||
async function detectLatestWeeklyTag() {
|
|
||||||
const releases = await github.paginate(github.rest.repos.listReleases, { owner, repo, per_page: 100 });
|
|
||||||
const cand = releases.find(r => r.prerelease && typeof r.tag_name === 'string' && rx.test(r.tag_name));
|
|
||||||
return cand?.tag_name || null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!currentTag) {
|
|
||||||
currentTag = await detectLatestWeeklyTag();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!currentTag || !rx.test(currentTag)) {
|
|
||||||
core.info(`No weekly tag detected or tag format mismatch ('${currentTag}'). Skipping.`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Resolve the current release object
|
|
||||||
let curRel;
|
|
||||||
try {
|
|
||||||
const { data } = await github.rest.repos.getReleaseByTag({ owner, repo, tag: currentTag });
|
|
||||||
curRel = data;
|
|
||||||
} catch (e) {
|
|
||||||
core.setFailed(`No release for tag ${currentTag}: ${e.message}`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If event is a normal release (not pre-release), skip automatically-run case;
|
|
||||||
// but allow manual override (manual runs can patch any weekly tag).
|
|
||||||
const isManual = context.eventName === 'workflow_dispatch';
|
|
||||||
if (!isManual && !curRel.prerelease) {
|
|
||||||
core.info('Current release is not a pre-release; skipping (auto run).');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helpers
|
|
||||||
const toPrevWeeklyTag = (tag) => {
|
|
||||||
const [, y, m, d] = tag.match(rx);
|
|
||||||
const dt = new Date(Date.UTC(+y, +m - 1, +d));
|
|
||||||
const prev = new Date(dt.getTime() - 7 * 24 * 3600 * 1000); // minus 7 days
|
|
||||||
const iso = prev.toISOString().slice(0, 10); // YYYY-MM-DD
|
|
||||||
return `weekly-${iso.replace(/-/g, '.')}`; // weekly-YYYY.MM.DD
|
|
||||||
};
|
|
||||||
const ymdKey = (t) => t.replace(rx, '$1$2$3'); // YYYYMMDD
|
|
||||||
|
|
||||||
async function tagExists(tag) {
|
|
||||||
try {
|
|
||||||
await github.rest.git.getRef({ owner, repo, ref: `tags/${tag}` });
|
|
||||||
return true;
|
|
||||||
} catch {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Compute previous weekly deterministically, then fall back if needed
|
|
||||||
let prevTag = toPrevWeeklyTag(currentTag);
|
|
||||||
if (!(await tagExists(prevTag))) {
|
|
||||||
core.info(`Computed previous tag ${prevTag} not found; scanning older weeklies...`);
|
|
||||||
const releases = await github.paginate(github.rest.repos.listReleases, { owner, repo, per_page: 100 });
|
|
||||||
const curKey = ymdKey(currentTag);
|
|
||||||
const older = releases
|
|
||||||
.filter(r => r.prerelease && typeof r.tag_name === 'string' && rx.test(r.tag_name))
|
|
||||||
.map(r => ({ tag: r.tag_name, key: ymdKey(r.tag_name) }))
|
|
||||||
.filter(x => x.key < curKey)
|
|
||||||
.sort((a, b) => b.key.localeCompare(a.key)); // newest older first
|
|
||||||
if (!older.length) {
|
|
||||||
core.info('No older weekly found; nothing to do.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
prevTag = older[0].tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
const compareUrl = `https://github.com/${owner}/${repo}/compare/${prevTag}...${currentTag}`;
|
|
||||||
const head = `**Changes since last weekly (${prevTag} → ${currentTag}):**\n${compareUrl}\n`;
|
|
||||||
|
|
||||||
if (process.env.DRY_RUN === 'true') {
|
|
||||||
core.info(`[DRY RUN] Would update release ${currentTag} with: ${compareUrl}`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Idempotent body update
|
|
||||||
let body = curRel.body || '';
|
|
||||||
if (body.includes(compareUrl)) {
|
|
||||||
core.info('Compare URL already present; done.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const placeholder = process.env.PLACEHOLDER || '<!--DIFF_LINK-->';
|
|
||||||
if (body.includes(placeholder)) {
|
|
||||||
body = body.replace(placeholder, compareUrl);
|
|
||||||
} else if (/\*\*Changes since last weekly:/i.test(body)) {
|
|
||||||
body = body.replace(/\*\*Changes since last weekly:[^\n]*\n?/i, head + '\n');
|
|
||||||
} else {
|
|
||||||
body += (body.endsWith('\n') ? '\n' : '\n\n') + head;
|
|
||||||
}
|
|
||||||
|
|
||||||
await github.rest.repos.updateRelease({ owner, repo, release_id: curRel.id, body });
|
|
||||||
core.info(`Release notes updated with compare link: ${compareUrl}`);
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,6 +10,7 @@
|
|||||||
!/.pre-commit-config.yaml
|
!/.pre-commit-config.yaml
|
||||||
!/.pylintrc
|
!/.pylintrc
|
||||||
!/.github/
|
!/.github/
|
||||||
|
!/.gitea/
|
||||||
!/contrib/.vscode/
|
!/contrib/.vscode/
|
||||||
!*.gitattributes
|
!*.gitattributes
|
||||||
!*.gitignore
|
!*.gitignore
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ cmake \
|
|||||||
-B build \
|
-B build \
|
||||||
-S .
|
-S .
|
||||||
|
|
||||||
cmake --build build
|
cmake --build build -j${CPU_COUNT:-16}
|
||||||
cmake --install build
|
cmake --install build
|
||||||
|
|
||||||
mv ${PREFIX}/bin/FreeCAD ${PREFIX}/bin/freecad || true
|
mv ${PREFIX}/bin/FreeCAD ${PREFIX}/bin/freecad || true
|
||||||
|
|||||||
Reference in New Issue
Block a user