diff --git a/.github/workflows/ci_linux_arch.yml b/.github/workflows/ci_linux_arch.yml new file mode 100644 index 00000000..92114b07 --- /dev/null +++ b/.github/workflows/ci_linux_arch.yml @@ -0,0 +1,37 @@ +name: Linux Arch x64 + +on: [push] + +jobs: + build-archlinux: + runs-on: ubuntu-latest + name: build-archlinux-qt5 + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + path: 'mayo' + + - name: Setup Podman + run: | + sudo apt update + sudo apt-get -y install podman + podman pull docker.io/library/archlinux:latest + + - name: Create container and run build+tests + run: | + { + echo 'FROM archlinux:latest' + echo 'RUN pacman -Syu --noconfirm' + echo 'RUN pacman -Sy --noconfirm make cmake git gcc' + echo 'RUN pacman -Sy --noconfirm qt5-base qt5-svg xcb-util-cursor' + echo 'RUN pacman -Sy --noconfirm opencascade libxi' + echo 'RUN pacman -Sy --noconfirm assimp' + echo 'COPY mayo mayo' + echo 'RUN mkdir /mayo/build' + echo 'WORKDIR /mayo/build' + echo 'RUN cmake .. -DMayo_BuildTests=ON -DMayo_BuildPluginAssimp=ON' + echo 'RUN cmake --build . --parallel --config Release' + } > podmanfile + podman build --tag archlinux-ci -f ./podmanfile diff --git a/.github/workflows/ci_linux_arm.yml b/.github/workflows/ci_linux_arm.yml deleted file mode 100644 index 34f2f141..00000000 --- a/.github/workflows/ci_linux_arm.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: Linux ARM - -on: [push] - -jobs: - build-linux-arm: - strategy: - matrix: - include: - - arch: aarch64 - distro: ubuntu_latest - #- arch: aarch64 - # distro: fedora_latest - - arch: armv7 - distro: archarm_latest - - - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Get current branch name - uses: nelonoel/branch-name@v1.0.1 - - - name: Run Build - uses: uraimo/run-on-arch-action@v2 - with: - arch: ${{matrix.arch}} - - distro: ${{matrix.distro}} - - # Not required, but speeds up builds - githubToken: ${{github.token}} - - install: | - case "${{ matrix.distro }}" in - ubuntu*) - apt-get -y update - apt-get -y install xvfb # Needed to run unit tests - apt-get -y install cmake - apt-get -y install git - apt-get -y install g++ - apt-get -y install qtbase5-dev libqt5svg5-dev - apt-get -y install libxcb-cursor0 # Dependencies for "xcb" Qt plugin(actually needed for Qt6) - apt-get -y install libocct-data-exchange-dev libocct-draw-dev occt-misc - apt-get -y install libtbb-dev libxi-dev # Dependencies for OpenCascade - apt-get -y install libassimp-dev - ;; - fedora*) - dnf -y update - dnf -y install xorg-x11-server-Xvfb - dnf -y install make cmake - dnf -y install git - dnf -y install gcc-c++ - dnf -y install qt5-qtbase qt5-qtsvg - dnf -y install xcb-util-cursor - dnf -y install opencascade-devel - dnf -y install assimp assimp-devel - ;; - archarm*) - # See https://github.com/moby/buildkit/issues/1267#issuecomment-769880570 - sed -i -e 's~#IgnorePkg.*~IgnorePkg = filesystem~g' '/etc/pacman.conf' - pacman -Syu --noconfirm - pacman -Sy --noconfirm xorg-server-xvfb - pacman -Sy --noconfirm make cmake - pacman -Sy --noconfirm git - pacman -Sy --noconfirm gcc - pacman -Sy --noconfirm qt5-base qt5-svg - pacman -Sy --noconfirm xcb-util-cursor - pacman -Sy --noconfirm opencascade - pacman -Sy --noconfirm libxi - pacman -Sy --noconfirm assimp - ;; - esac - - env: | - DISPLAY: :0 - GIT_BRANCH_NAME: ${{env.BRANCH_NAME}} - RUN_ARCH_NAME: ${{matrix.arch}} - - run: | - git clone --quiet https://github.com/fougue/mayo.git - cd mayo - - # Fixes "fatal: detected dubious ownership in repository at '/home/runner/work/mayo/mayo'" - git config --global --add safe.directory `realpath $PWD/..` - - echo GIT_BRANCH_NAME=$GIT_BRANCH_NAME - git checkout $GIT_BRANCH_NAME - cd .. - mkdir build - cd build - - cmake --version - cmake .. \ - -DMayo_BuildTests=ON \ - -DMayo_BuildPluginAssimp=ON - cmake --build . \ - --config Release \ - --parallel `nproc` - - # - # Execute Unit Tests - # Note: for some unknown reason unit tests are crashing for armv7(on very first test) - # so just execute them for aarch64 - # - if [ $RUN_ARCH_NAME = 'aarch64' ]; then - - # Start X11 display server - Xvfb $DISPLAY -screen 0 1280x1024x24 & - sleep 5s - ./mayo --runtests - - else - echo "NOTE: unit tests skipped, they need to be fixed for this architecture" - fi diff --git a/.github/workflows/ci_linux_fedora.yml b/.github/workflows/ci_linux_fedora.yml new file mode 100644 index 00000000..b3089f5d --- /dev/null +++ b/.github/workflows/ci_linux_fedora.yml @@ -0,0 +1,43 @@ +name: Linux Fedora x64 + +on: [push] + +jobs: + build-fedora: + runs-on: ubuntu-latest + name: build-fedora40-qt5 + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + path: 'mayo' + + - name: Setup Podman + run: | + sudo apt update + sudo apt-get -y install podman + podman pull fedora:40 + + - name: Create container and run build+tests + run: | + { + echo 'FROM fedora:40' + echo 'RUN dnf -y update' + echo 'RUN dnf -y install xorg-x11-server-Xvfb' + echo 'RUN dnf -y install make cmake git gcc-c++' + echo 'RUN dnf -y install qt5-qtbase qt5-qtsvg xcb-util-cursor' + echo 'RUN dnf -y install opencascade-devel' + echo 'RUN dnf -y install assimp assimp-devel' + echo 'RUN dnf clean all' + echo 'COPY mayo mayo' + echo 'WORKDIR /mayo' + echo 'RUN mkdir build' + echo 'WORKDIR /mayo/build' + echo 'RUN cmake .. -DMayo_BuildTests=ON -DMayo_BuildPluginAssimp=ON' + echo 'RUN cmake --build . --parallel --config Release' + #echo 'RUN Xvfb $DISPLAY -screen 0 1280x1024x24 &' + #echo 'RUN sleep 5s' + #echo 'RUN ./mayo --runtests' + } > podmanfile + podman build --tag fedora40-ci -f ./podmanfile diff --git a/.github/workflows/ci_linux.yml b/.github/workflows/ci_linux_ubuntu.yml similarity index 66% rename from .github/workflows/ci_linux.yml rename to .github/workflows/ci_linux_ubuntu.yml index e64e608b..01c2570d 100644 --- a/.github/workflows/ci_linux.yml +++ b/.github/workflows/ci_linux_ubuntu.yml @@ -1,31 +1,32 @@ -name: Linux +name: Linux Ubuntu x64/arm64 on: [push] jobs: - build-linux: + build-ubuntu: strategy: matrix: - qt_version: [5.15.2, 6.5.2] + qt_version_major: [5, 6] + os: [ubuntu-latest, ubuntu-24.04-arm] - runs-on: ubuntu-latest - name: build-linux-qt${{matrix.qt_version}} + runs-on: ${{matrix.os}} + name: build-${{matrix.os}}-qt${{matrix.qt_version_major}} steps: - name: Checkout uses: actions/checkout@v2 - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - version: ${{matrix.qt_version}} - cache: true - cache-key-prefix: QtCache + - name: Update all package informations + run: | + sudo apt-get -y update - # Actually needed for Qt6 - - name: Install dependencies for "xcb" Qt plugin + - name: Install Qt${{matrix.qt_version_major}} run: | - sudo apt-get -y install libxcb-cursor0 + if [[ ${{matrix.qt_version_major}} == "5" ]]; then + sudo apt-get -y install qtbase5-dev libqt5svg5-dev + elif [[ ${{matrix.qt_version_major}} == "6" ]]; then + sudo apt-get -y install qt6-base-dev qt6-svg-dev libxcb-cursor0 + fi - name: Install OpenCascade run: | diff --git a/.github/workflows/ci_linux_ubuntu_armv7.yml b/.github/workflows/ci_linux_ubuntu_armv7.yml new file mode 100644 index 00000000..f7e5f226 --- /dev/null +++ b/.github/workflows/ci_linux_ubuntu_armv7.yml @@ -0,0 +1,79 @@ +name: Linux Ubuntu armv7 + +on: [push] + +jobs: + build-ubuntu: + strategy: + matrix: + include: + - arch: armv7 + distro: ubuntu_latest + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Get current branch name + uses: nelonoel/branch-name@v1.0.1 + + - name: Run Build + uses: uraimo/run-on-arch-action@v2 + with: + arch: ${{matrix.arch}} + distro: ${{matrix.distro}} + + # Not required, but speeds up builds + githubToken: ${{github.token}} + + install: | + apt-get -y update + + apt-get -y install cmake git g++ + + # Needed to run unit tests + apt-get -y install xvfb + + # Install Qt5 + apt-get -y install qtbase5-dev libqt5svg5-dev + + # Dependencies for "xcb" Qt plugin(actually needed for Qt6) + apt-get -y install libxcb-cursor0 + + # Install OpenCascade + apt-get -y install libocct-data-exchange-dev libocct-draw-dev occt-misc + + # Dependencies for OpenCascade + apt-get -y install libtbb-dev libxi-dev + + # Install Assimp + apt-get -y install libassimp-dev + + env: | + DISPLAY: :0 + GIT_BRANCH_NAME: ${{env.BRANCH_NAME}} + RUN_ARCH_NAME: ${{matrix.arch}} + + run: | + git clone --quiet https://github.com/fougue/mayo.git + cd mayo + + # Fixes "fatal: detected dubious ownership in repository at '/home/runner/work/mayo/mayo'" + git config --global --add safe.directory `realpath $PWD/..` + + echo GIT_BRANCH_NAME=$GIT_BRANCH_NAME + git checkout $GIT_BRANCH_NAME + cd .. + mkdir build + cd build + + cmake .. -DMayo_BuildTests=ON -DMayo_BuildPluginAssimp=ON + cmake --build . --config Release --parallel `nproc` + + # Execute Unit Tests + # Note: for some unknown reason unit tests are crashing for armv7(on very first test) + ## Xvfb $DISPLAY -screen 0 1280x1024x24 & + ## sleep 5s + ## ./mayo --runtests diff --git a/.github/workflows/ci_macos.yml b/.github/workflows/ci_macos.yml index 5baf36e0..cdef230a 100644 --- a/.github/workflows/ci_macos.yml +++ b/.github/workflows/ci_macos.yml @@ -1,4 +1,5 @@ -name: macOS +#name: macOS x64/arm64 +name: macOS arm64 on: [push] @@ -6,16 +7,19 @@ jobs: build-macos: strategy: matrix: - include: - - qt_version_name: 5.15 - qt_version_major: 5 - - qt_version_name: 6.7 - qt_version_major: 6 + qt_version_major: [5, 6] + os: [macos-latest] + #os: [macos-latest-large, macos-latest-xlarge] - runs-on: macos-latest - name: build-macos-qt${{matrix.qt_version_name}} + runs-on: ${{matrix.os}} + name: build-${{matrix.os}}-qt${{matrix.qt_version_major}} steps: + - name: Set globals + id: globals + run: | + echo qt_path=$(brew --prefix qt@${{matrix.qt_version_major}}) >> ${GITHUB_OUTPUT} + - name: Checkout uses: actions/checkout@v2 @@ -40,7 +44,7 @@ jobs: cmake .. \ -DMayo_BuildTests=ON \ -DMayo_BuildPluginAssimp=ON \ - -DQT_DIR=$(brew --prefix qt@${{matrix.qt_version_major}})/lib/cmake/Qt${{matrix.qt_version_major}} + -DQT_DIR=${{steps.globals.outputs.qt_path}}/lib/cmake/Qt${{matrix.qt_version_major}} cmake --build . \ --config Release \ --parallel ${{steps.cpu-cores.outputs.count}} diff --git a/.github/workflows/ci_macos_conda.yml b/.github/workflows/ci_macos_conda.yml index b3371660..695db207 100644 --- a/.github/workflows/ci_macos_conda.yml +++ b/.github/workflows/ci_macos_conda.yml @@ -1,11 +1,11 @@ -name: macOS-conda +name: macOS-conda arm64 on: [push] jobs: - build-macos: + build-macos-conda: runs-on: macos-latest - name: build-macos-qt${{matrix.qt_version_name}} + name: build-macos-qt5 steps: - name: Checkout diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index c3bf2272..e0437964 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -1,9 +1,9 @@ -name: Windows +name: Windows x64 on: [push] jobs: - build-windows-msvc: + build-windows: strategy: matrix: include: diff --git a/CMakeLists.txt b/CMakeLists.txt index 884e69c3..a82c78a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -679,8 +679,10 @@ endif() # Mayo_BuildConvCli add_custom_target( OtherFiles SOURCES - .github/workflows/ci_linux.yml - .github/workflows/ci_linux_arm.yml + .github/workflows/ci_linux_arch.yml + .github/workflows/ci_linux_fedora.yml + .github/workflows/ci_linux_ubuntu.yml + .github/workflows/ci_linux_ubuntu_armv7.yml .github/workflows/ci_macos.yml .github/workflows/ci_macos_conda.yml .github/workflows/ci_windows.yml diff --git a/README.md b/README.md index 79c7b129..700e1922 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@