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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 162 additions & 0 deletions .github/workflows/build-binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# .github/workflows/build-binary.yml
# Reusable workflow – called by continuous-integration.yml and nightly.yml

name: Build binary

on:
workflow_call:
inputs:
build_label:
description: "Label appended to the output folder name, e.g. '20240101-abc1234'"
type: string
required: true
os:
description: "Runner OS: 'ubuntu-22.04' or 'windows-latest'"
type: string
required: true
outputs:
artifact_name:
description: "Name of the uploaded artifact"
value: ${{ jobs.build.outputs.artifact_name }}

jobs:
build:
runs-on: ${{ inputs.os }}

outputs:
artifact_name: ${{ steps.set-names.outputs.artifact_name }}

steps:
- uses: actions/checkout@v6

- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: Compute platform names
id: set-names
shell: bash
run: |
if [ "$RUNNER_OS" = "Windows" ]; then
echo "platform=windows" >> "$GITHUB_OUTPUT"
echo "output_dir=Meshroom-${{ inputs.build_label }}-windows" >> "$GITHUB_OUTPUT"
echo "archive=Meshroom-${{ inputs.build_label }}-windows.zip" >> "$GITHUB_OUTPUT"
echo "artifact_name=binary-windows" >> "$GITHUB_OUTPUT"
else
echo "platform=linux" >> "$GITHUB_OUTPUT"
echo "output_dir=Meshroom-${{ inputs.build_label }}-linux" >> "$GITHUB_OUTPUT"
echo "archive=Meshroom-${{ inputs.build_label }}-linux.tar.gz" >> "$GITHUB_OUTPUT"
echo "artifact_name=binary-linux" >> "$GITHUB_OUTPUT"
fi

- name: Install system dependencies (Linux only)
if: runner.os == 'Linux'
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
libgl1 libglib2.0-0 libdbus-1-3 \
libxcb-cursor0 libxcb-xinerama0 libxcb-icccm4 \
libxcb-image0 libxcb-keysyms1 libxcb-randr0 \
libxcb-render-util0 libxcb-shape0 libxkbcommon-x11-0

- name: Install Python dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r dev_requirements.txt

- name: Build executable
shell: bash
env:
OUTPUT_DIR: ${{ steps.set-names.outputs.output_dir }}
run: |
python setup.py install_exe -d "$OUTPUT_DIR"

- name: Fix missing PySide6 DLL (Windows only)
if: runner.os == 'Windows'
shell: cmd
env:
OUTPUT_DIR: ${{ steps.set-names.outputs.output_dir }}
run: |
curl -L "https://drive.google.com/uc?export=download&id=1vhPDmDQJJfM_hBD7KVqRfh8tiqTCN7Jv" ^
-o "%OUTPUT_DIR%\lib\PySide6\Qt63DQuickScene3D.dll"

- name: Remove unused PySide6 files (Windows)
if: runner.os == 'Windows'
shell: cmd
env:
OUTPUT_DIR: ${{ steps.set-names.outputs.output_dir }}
run: |
cd "%OUTPUT_DIR%\lib\PySide6"
del /s /q Qt6Web*.dll Qt6Designer*.dll *.exe
if exist resources rmdir /s /q resources
if exist translations rmdir /s /q translations
if exist typesystems rmdir /s /q typesystems
if exist examples rmdir /s /q examples
if exist include rmdir /s /q include

- name: Remove unused PySide6 files (Linux)
if: runner.os == 'Linux'
env:
OUTPUT_DIR: ${{ steps.set-names.outputs.output_dir }}
run: |
cd "${OUTPUT_DIR}/lib/PySide6"
rm -rf resources translations typesystems examples include
cd Qt/lib
rm -f \
*Qt6WebEngine*.so* \
*Qt6Designer*.so* \
*Qt6Multimedia*.so* \
*Qt6SpatialAudio*.so* \
*Qt6Charts*.so* \
*Qt6DataVisualization*.so* \
*Qt6Graphs*.so* \
*Qt6Bluetooth*.so* \
*Qt6Nfc*.so* \
*Qt6SerialPort*.so* \
*Qt6SerialBus*.so* \
*Qt6Positioning*.so* \
*Qt6Location*.so* \
*Qt6Sensors*.so* \
*Qt6TextToSpeech*.so* \
*Qt6VirtualKeyboard*.so* \
*Qt6WebSockets*.so* \
*Qt6WebChannel*.so* \
*Qt6Pdf*.so* \
*Qt6Quick3D*.so* \
*Qt6RemoteObjects*.so* \
*Qt6Scxml*.so* \
*Qt6StateMachine*.so* \
*Qt6NetworkAuth*.so*

- name: Strip debug symbols from .so files (Linux)
if: runner.os == 'Linux'
env:
OUTPUT_DIR: ${{ steps.set-names.outputs.output_dir }}
run: |
find "$OUTPUT_DIR" -name "*.so*" -not -type l | xargs strip --strip-unneeded

- name: Create archive (Windows)
if: github.workflow == 'Nightly' && runner.os == 'Windows'
shell: pwsh
env:
OUTPUT_DIR: ${{ steps.set-names.outputs.output_dir }}
ARCHIVE: ${{ steps.set-names.outputs.archive }}
run: Compress-Archive -Path "$env:OUTPUT_DIR" -DestinationPath "$env:ARCHIVE"

- name: Create archive (Linux)
if: github.workflow == 'Nightly' && runner.os == 'Linux'
env:
OUTPUT_DIR: ${{ steps.set-names.outputs.output_dir }}
ARCHIVE: ${{ steps.set-names.outputs.archive }}
run: tar -czf "$ARCHIVE" "$OUTPUT_DIR"

- name: Upload artifact
uses: actions/upload-artifact@v7
if: github.workflow == 'Nightly'
with:
name: ${{ steps.set-names.outputs.artifact_name }}
path: ${{ steps.set-names.outputs.archive }}
retention-days: 1

104 changes: 16 additions & 88 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# .github/workflows/continuous-integration.yml

name: Continuous Integration

on:
Expand All @@ -16,93 +18,19 @@
- '**.rst'
- 'docs/**'

env:
CI: True
PYTHONPATH: ${{ github.workspace }}

jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.11 ]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
pip install -r requirements.txt -r dev_requirements.txt --timeout 45
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest tests/
pytest --cov --cov-report=xml --junitxml=junit.xml
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Set up Python 3.9 - meshroom_compute test
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies (Python 3.9) - meshroom_compute test
run: |
python3.9 -m pip install --upgrade pip
python3.9 -m pip install -r requirements.txt --timeout 45
- name: Run imports - meshroom_compute test
run: |
python3.9 bin/meshroom_compute -h

build-windows:
runs-on: windows-latest
strategy:
matrix:
python-version: [ 3.11 ]
test-linux:
name: Test (Linux)
uses: ./.github/workflows/run-tests.yml
with:
os: ubuntu-latest
python-version: '3.11'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -r requirements.txt -r dev_requirements.txt --timeout 45
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest tests/
- name: Set up Python 3.9 - meshroom_compute test
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies (Python 3.9) - meshroom_compute test
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt --timeout 45
- name: Run imports - meshroom_compute test
run: |
python3 bin/meshroom_compute -h
test-windows:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Comment on lines +23 to +31
name: Test (Windows)
uses: ./.github/workflows/run-tests.yml
with:
os: windows-latest
python-version: '3.11'

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Comment on lines +32 to +36
Loading
Loading