Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into java-doc-aggregate
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Nov 1, 2024
2 parents b844564 + e974436 commit 1aed5be
Show file tree
Hide file tree
Showing 120 changed files with 1,122 additions and 895 deletions.
55 changes: 11 additions & 44 deletions .github/actions/setup-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Setup Dependencies

inputs:
use_matlab:
description: "Indicates whether to install and configure MATLAB"
type: choice
required: true
default: "false"
options:
- true
- false
use_ccache:
description: "Indicates whether to install and configure ccache"
type: choice
Expand Down Expand Up @@ -100,50 +108,9 @@ runs:
#
# MATLAB
#
- name: Setup MATLAB
id: setup-matlab
uses: matlab-actions/setup-matlab@v2
with:
release: "R2024a"
if: matrix.config == 'matlab'

- name: Set MATLAB_HOME and MATLAB_VERSION
run: |
# Needed for MATLAB R2024a
sudo apt install -y libgtk2.0-0
echo "MATLAB_VERSION=R2024a" >> $GITHUB_ENV
echo "MATLAB_HOME=${{ steps.setup-matlab.outputs.matlabroot }}" >> $GITHUB_ENV
shell: bash
if: runner.os == 'Linux' && matrix.config == 'matlab'

- name: Set MATLAB_HOME and MATLAB_VERSION
run: |
echo "MATLAB_VERSION=R2024a" >> $env:GITHUB_ENV
echo "MATLAB_HOME=${{ steps.setup-matlab.outputs.matlabroot }}" >> $env:GITHUB_ENV
shell: powershell
if: runner.os == 'Windows' && matrix.config == 'matlab'

# https://github.com/matlab-actions/run-command/issues/53
- name: Get run-matlab-command
run: |
wget -O /usr/local/bin/run-matlab-command https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v2/glnxa64/run-matlab-command
chmod +x /usr/local/bin/run-matlab-command
echo "MATLAB_COMMAND=/usr/local/bin/run-matlab-command" >> $GITHUB_ENV
# https://www.mathworks.com/matlabcentral/answers/1907290-how-to-manually-select-the-libstdc-library-to-use-to-resolve-a-version-glibcxx_-not-found
echo "LD_PRELOAD=/lib/x86_64-linux-gnu/libstdc++.so.6" >> $GITHUB_ENV
shell: bash
if: runner.os == 'Linux' && matrix.config == 'matlab'

# Windows is currently not working. We get an error: "'matlab' executable not found on the system path"
# However, MATLAB is installed and the path is (seemingly) set correctly
- name: Get run-matlab-command
run: |
Invoke-WebRequest https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v2/win64/run-matlab-command.exe -OutFile C:\Windows\System32\run-matlab-command.exe
echo "MATLAB_COMMAND=C:\Windows\System32\run-matlab-command.exe" >> $env:GITHUB_ENV
shell: powershell
if: runner.os == 'Windows' && matrix.config == 'matlab'
- name: Setup Dependencies
uses: ./.github/actions/setup-matlab
if: inputs.use_matlab == 'true'

#
# Cache
Expand Down
51 changes: 51 additions & 0 deletions .github/actions/setup-matlab/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Setup MATLAB
description: Setup MATLAB for use in GitHub Actions
runs:
using: "composite"
steps:
#
# MATLAB
#
- name: Setup MATLAB
id: setup-matlab
uses: matlab-actions/setup-matlab@v2
with:
release: "R2024a"

- name: Set MATLAB_HOME and MATLAB_VERSION
run: |
# Needed for MATLAB R2024a
sudo apt install -y libgtk2.0-0
echo "MATLAB_VERSION=R2024a" >> $GITHUB_ENV
echo "MATLAB_HOME=${{ steps.setup-matlab.outputs.matlabroot }}" >> $GITHUB_ENV
shell: bash
if: runner.os == 'Linux'

- name: Set MATLAB_HOME and MATLAB_VERSION
run: |
echo "MATLAB_VERSION=R2024a" >> $env:GITHUB_ENV
echo "MATLAB_HOME=${{ steps.setup-matlab.outputs.matlabroot }}" >> $env:GITHUB_ENV
shell: powershell
if: runner.os == 'Windows'

# https://github.com/matlab-actions/run-command/issues/53
- name: Get run-matlab-command
run: |
wget -O /usr/local/bin/run-matlab-command https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v2/glnxa64/run-matlab-command
chmod +x /usr/local/bin/run-matlab-command
echo "MATLAB_COMMAND=/usr/local/bin/run-matlab-command" >> $GITHUB_ENV
# https://www.mathworks.com/matlabcentral/answers/1907290-how-to-manually-select-the-libstdc-library-to-use-to-resolve-a-version-glibcxx_-not-found
echo "LD_PRELOAD=/lib/x86_64-linux-gnu/libstdc++.so.6" >> $GITHUB_ENV
shell: bash
if: runner.os == 'Linux'

# Windows is currently not working. We get an error: "'matlab' executable not found on the system path"
# However, MATLAB is installed and the path is (seemingly) set correctly
- name: Get run-matlab-command
run: |
Invoke-WebRequest https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v2/win64/run-matlab-command.exe -OutFile C:\Windows\System32\run-matlab-command.exe
echo "MATLAB_COMMAND=C:\Windows\System32\run-matlab-command.exe" >> $env:GITHUB_ENV
shell: powershell
if: runner.os == 'Windows' && matrix.config == 'matlab'
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ jobs:
- os: ubuntu-24.04
config: "cross"
test_flags: "--all-cross"
- os: macos-15
config: "cross"
# We want to test C++ and Swift only (in each direction)
test_flags: "--all-cross --filter cpp --filter swift"

runs-on: ${{ matrix.os }}
steps:
Expand All @@ -89,6 +93,8 @@ jobs:

- name: Setup Dependencies
uses: ./.github/actions/setup-dependencies
with:
use_matlab: ${{ matrix.config == 'matlab' }}

- name: Build ${{ matrix.config }} on ${{ matrix.os }}
uses: ./.github/actions/build
Expand Down Expand Up @@ -123,4 +129,5 @@ jobs:
with:
name: crash-diagnostics-${{ matrix.config }}-${{ matrix.os }}
path: ~/Library/Logs/DiagnosticReports/*.ips
if-no-files-found: ignore
if: runner.os == 'macOS' && always()
5 changes: 4 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ jobs:
- name: Install awscli
run: brew install awscli || true

# Use --formula to silence homebrew warning when installing doxygen from a formula.
- name: Install doxygen and graphviz (a dependency of Doxygen for generating diagrams)
run: brew install doxygen graphviz || true
run: |
brew install graphviz || true
brew install doxygen --formula || true
- name: Install docfx for C# API reference
run: brew install docfx
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/matlab_analyzer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Matlab Analyzer

on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]

jobs:
matlab-analyzer:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Dependencies
uses: ./.github/actions/setup-dependencies
with:
use_matlab: true

- name: Build MATLAB on Ubuntu
uses: ./.github/actions/build
timeout-minutes: 90
with:
working_directory: "matlab"
build_cpp_and_python: true

- name: MATLAB Analyzer
run: |
$MATLAB_COMMAND code_analyzer
working-directory: ./matlab/config
shell: bash

- name: Upload Analyzer Report
uses: actions/upload-artifact@v4
with:
name: matlab-analyzer-report
path: ./matlab/config/result.json
if-no-files-found: ignore
if: always()
2 changes: 1 addition & 1 deletion config/Make.project.rules
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ $2_distclean::
#
ifeq ($$($2_devinstall),yes)
ifneq ($$(and $$($2_components),$(filter library,$3),$$(filter $(includedir)/%,$$($2_includedir))),)
$$(eval $$(call install-data-files,$$(wildcard $$($2_includedir)/*.h),$(includedir),$(install_includedir),$2_install))
$$(eval $$(call install-data-files,$$(wildcard $$($2_includedir)/*.h) $$(wildcard $$($2_includedir)/**/*.h),$(includedir),$(install_includedir),$2_install))
ifneq ($$($2_generated_headers),)
$$(eval $$(call install-data-files,$$($2_generated_headers),$(includedir)/generated,$(install_includedir),$2_install))
endif
Expand Down
13 changes: 9 additions & 4 deletions config/makeprops.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ def openFiles(self):
{{
const char* name;
const bool prefixOnly;
const bool isOptIn;
const Property* properties;
const int length;
const bool isOptIn;
}};
class PropertyNames
Expand Down Expand Up @@ -330,9 +330,9 @@ def writePropertyArray(self, propertyArray):
{{
.name="{name}",
.prefixOnly={prefixOnly},
.isOptIn={isOptIn},
.properties={name}PropsData,
.length={len(propertyArray.properties)},
.isOptIn={isOptIn}
.length={len(propertyArray.properties)}
}};
""")
Expand Down Expand Up @@ -408,6 +408,7 @@ def fix(self, propertyName):
def writePropertyArray(self, propertyArray):
name = propertyArray.name
prefixOnly = "true" if propertyArray.prefixOnly else "false"
isOptIn = "true" if propertyArray.isOptIn else "false"
properties = (
"\n " + ",\n ".join(propertyArray.properties)
if propertyArray.properties
Expand All @@ -418,6 +419,7 @@ def writePropertyArray(self, propertyArray):
f""" public static final PropertyArray {name}Props = new PropertyArray(
"{name}",
{prefixOnly},
{isOptIn},
new Property[] {{{properties}
}});
Expand Down Expand Up @@ -505,6 +507,7 @@ def fix(self, propertyName):
def writePropertyArray(self, propertyArray):
name = propertyArray.name
prefixOnly = "true" if propertyArray.prefixOnly else "false"
isOptIn = "true" if propertyArray.isOptIn else "false"
properties = (
f"\n {",\n ".join(propertyArray.properties)}\n "
if propertyArray.properties
Expand All @@ -515,6 +518,7 @@ def writePropertyArray(self, propertyArray):
internal static PropertyArray {name}Props = new(
"{name}",
{prefixOnly},
{isOptIn},
[{properties}]);
""")
Expand Down Expand Up @@ -583,6 +587,7 @@ def fix(self, propertyName):
def writePropertyArray(self, propertyArray):
name = propertyArray.name
prefixOnly = "true" if propertyArray.prefixOnly else "false"
isOptIn = "true" if propertyArray.isOptIn else "false"
properties = (
"\n " + ",\n ".join(propertyArray.properties)
if propertyArray.properties
Expand All @@ -591,7 +596,7 @@ def writePropertyArray(self, propertyArray):
# We assign the properties to the property array after creating it so that we can reference the array
# in the properties themselves
self.srcFile.write(f"""\
PropertyNames.{name}Props = new PropertyArray("{name}", {prefixOnly});
PropertyNames.{name}Props = new PropertyArray("{name}", {prefixOnly}, {isOptIn});
PropertyNames.{name}Props.properties = [{properties}
];
Expand Down
Loading

0 comments on commit 1aed5be

Please sign in to comment.