Skip to content

Add more function tests #1011

Add more function tests

Add more function tests #1011

Workflow file for this run

name: RapCAD
on:
push:
branches: [master, development]
tags: v[0-9]+.[0-9]+.[0-9]+
pull_request:
branches: [master, development]
jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
config: ['coverage', 'official']
shouldRelease:
- ${{ contains(github.ref, 'master') || startsWith(github.ref, 'refs/heads/v') }}
exclude:
- shouldRelease: false
config: official
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create Qt Directory
run: |
sudo mkdir /usr/Qt
sudo chown $(whoami) /usr/Qt
- name: Install Qt
uses: jurplel/install-qt-action@v4.3.0
with:
version: '6.5.*'
dir: /usr
cache: true
cache-key-prefix: Qt
- name: Install Dependencies
run: sudo apt-get install -y libboost-dev libcgal-dev libglu1-mesa-dev libxkbcommon-x11-0 libxcb-cursor0 libreadline-dev libgit2-dev
- name: Configure
run: qmake -o build/Makefile CONFIG+=${{ matrix.config }}
- name: Build
run: make -C build -j$(nproc)
- name: Test
if: ${{ matrix.config == 'coverage' }}
run: build/test/test --test test/assets
- name: Test GUI
if: ${{ matrix.config == 'coverage' }}
run: xvfb-run --server-args="-screen 0 1024x768x24" build/rapcad --test
- name: Coverage
if: ${{ matrix.config == 'coverage' }}
run: |
for dir in build/{gui,lib}; do \
pushd $dir; \
find . -type f -name '*.gcno' -exec gcov -p -r {} +; \
popd; \
done
- name: Upload Coverage
if: ${{ matrix.config == 'coverage' }}
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
windows:
runs-on: windows-2022
strategy:
matrix:
config: ['coverage', 'official']
shouldRelease:
- ${{ contains(github.ref, 'master') || startsWith(github.ref, 'refs/heads/v') }}
exclude:
- shouldRelease: false
config: official
env:
CGAL_DIR: C:\CGAL-5.4\
GMP: C:\CGAL-5.4\auxiliary\gmp
BOOST_ROOT: C:\boost_1_83_0
ASCIIDOC: C:\asciidoc-9.1.0\
MINGW: C:\mingw64\bin
LIBGIT2_DIR: C:\libgit2-1.9.1\
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Flex/Bison
run: |
choco install --no-progress -y winflexbison3
- name: Install LibGIT2
run: |
Invoke-WebRequest "https://github.com/libgit2/libgit2/archive/refs/tags/v1.9.1.zip" -OutFile "$env:TEMP\libgit2.zip"
7z x -oC:\ "$env:TEMP\libgit2.zip"
mkdir "$env:LIBGIT2_DIR\lib"
choco install --no-progress -y libgit2
cp "C:\ProgramData\chocolatey\lib\libgit2\tools\libgit2.dll" "$env:LIBGIT2_DIR\lib"
gendef "$env:LIBGIT2_DIR\lib\libgit2.dll"
dlltool -d libgit2.def --dllname libgit2.dll --output-lib "$env:LIBGIT2_DIR\lib\libgit2.lib"
- name: Install Boost
run: |
Invoke-WebRequest "https://archives.boost.io/release/1.83.0/source/boost_1_83_0.7z" -OutFile "$env:TEMP\boost.7z"
7z x -oC:\ "$env:TEMP\boost.7z"
- name: Install Qt
uses: jurplel/install-qt-action@v4.3.0
with:
version: '6.5.*'
dir: C:\
cache: true
cache-key-prefix: Qt
arch: win64_mingw
- name: Install CGAL
run: |
Invoke-WebRequest https://github.com/CGAL/cgal/releases/download/v5.4/CGAL-5.4.zip -OutFile "$env:TEMP\CGAL-release.zip"
7z x -oC:\ "$env:TEMP\CGAL-release.zip"
- name: Install GMP/MPFR
run: |
Invoke-WebRequest https://github.com/CGAL/cgal/releases/download/v5.4/CGAL-5.4-win64-auxiliary-libraries-gmp-mpfr.zip -OutFile "$env:TEMP\CGAL-gmp-mpfr.zip"
7z x -o"$env:CGAL_DIR" "$env:TEMP\CGAL-gmp-mpfr.zip" -aoa
- name: Install asciidoc/source-highlight
run: |
Invoke-WebRequest https://github.com/asciidoc-py/asciidoc-py/releases/download/9.1.0/asciidoc-9.1.0.zip -OutFile "$env:TEMP\asciidoc.zip"
7z x -oC:\ "$env:TEMP\asciidoc.zip"
Invoke-WebRequest -UserAgent "Wget" https://downloads.sourceforge.net/project/gnuwin32/src-highlite/2.1.2/src-highlite-2.1.2-bin.zip -OutFile "$env:TEMP\src-highlite.zip"
7z x -oC:\source-highlight "$env:TEMP\src-highlite.zip"
mv C:\source-highlight\bin\source-highlight.exe C:\source-highlight\bin\source-highlight-exe.exe
cp scripts\source-highlight.bat C:\source-highlight\bin
cp doc\csharp.lang C:\source-highlight\share\source-highlight
echo "`ncsharp = csharp.lang" >> C:\source-highlight\share\source-highlight\lang.map
echo "C:\source-highlight\bin" >> $env:GITHUB_PATH
- name: Configure pagefile
uses: al-cheb/configure-pagefile-action@v1.3
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "C:"
- name: Install nsis
run: |
choco install --no-progress -y nsis
- name: Version
run: |
echo "VERSION=$(cat VERSION)" >> $env:GITHUB_ENV
mv VERSION version.txt
- name: Configure
run: |
qmake -o build\Makefile CONFIG+=${{ matrix.config }}
- name: Build
run: mingw32-make -C build -j $env:NUMBER_OF_PROCESSORS release
- name: Clean
run: mingw32-make -C build clean
- name: Build documentation
run: |
mingw32-make -C build\doc user_guide.html
mv build\doc\user_guide.html build\
- name: Package
run: |
cp "$env:GMP\lib\libgmp-10.dll" build
cp "$env:GMP\lib\libmpfr-4.dll" build
windeployqt --no-svg --no-translations build\rapcad.exe
cp "$env:MINGW\libgcc_s_seh-1.dll" build
cp "$env:MINGW\libstdc++-6.dll" build
cp "$env:MINGW\libwinpthread-1.dll" build
cp "$env:LIBGIT2_DIR\lib\libgit2.dll" build
- name: Build installer
run: |
rm -Recurse build\imageformats
& 'C:\Program Files (x86)\NSIS\Bin\makensis.exe' /DBUILDDIR=build installer.nsi
mv rapcad_setup.exe "rapcad_$($env:VERSION)_setup.exe"
cp -Recurse build "rapcad_$env:VERSION"
7z a -tzip "rapcad_$env:VERSION.zip" "rapcad_$env:VERSION"
- name: Test
if: ${{ matrix.config == 'coverage' }}
run: |
mv .\build\test\release\test.exe .\build
.\build\test.exe --test test/assets
- name: Test GUI
if: ${{ matrix.config == 'coverage' }}
run: .\build\rapcad.exe --test
- name: Store
if: ${{ matrix.config == 'official' }}
uses: actions/upload-artifact@v4
with:
name: windows-artifacts
path: |
rapcad_*.exe
rapcad_*.zip
macos:
runs-on: macos-latest
strategy:
matrix:
config: ['coverage', 'official']
shouldRelease:
- ${{ contains(github.ref, 'master') || startsWith(github.ref, 'refs/heads/v') }}
exclude:
- shouldRelease: false
config: official
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create Qt Directory
run: |
sudo mkdir /opt/Qt
sudo chown $(whoami) /opt/Qt
- name: Install Qt
uses: jurplel/install-qt-action@v4.3.0
with:
version: '6.5.*'
dir: /opt
cache: true
cache-key-prefix: Qt
- name: Install Dependencies
run: |
brew install cgal bison libgit2
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
echo "BOOST_ROOT=$(brew --prefix boost)" >> $GITHUB_ENV
echo "CGAL_DIR=$(brew --prefix cgal)" >> $GITHUB_ENV
echo "GMP=$(brew --prefix gmp)" >> $GITHUB_ENV
echo "MPFR=$(brew --prefix mpfr)" >> $GITHUB_ENV
echo "LIBGIT2_DIR=$(brew --prefix libgit2)" >> $GITHUB_ENV
- name: Version
run: |
echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
mv VERSION version.txt
- name: Configure
run: |
qmake -o build/Makefile CONFIG+=${{ matrix.config }}
- name: Build
run: make -C build -j$(sysctl -n hw.ncpu)
- name: Package
run: |
sudo macdeployqt build/rapcad.app -dmg
mv build/rapcad.dmg rapcad_${{ env.VERSION }}.dmg
- name: Test
if: ${{ matrix.config == 'coverage' }}
run: build/test/test --test test/assets
- name: Test GUI
if: ${{ matrix.config == 'coverage' }}
run: build/rapcad.app/Contents/MacOS/rapcad --test
- name: Store
if: ${{ matrix.config == 'official' }}
uses: actions/upload-artifact@v4
with:
name: macos-artifacts
path: rapcad_*.dmg