Simplify yacc/lex config #719
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Cache Qt | |
id: cache-qt | |
uses: actions/cache@v3 | |
with: | |
path: /usr/Qt | |
key: ${{ runner.os }}-QtCache-6 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3.0.0 | |
with: | |
version: '6.5.*' | |
dir: /usr | |
cache: ${{ steps.cache-qt.outputs.cache-hit }} | |
- name: Install Dependencies | |
run: sudo apt-get install -y libboost-dev libcgal-dev libglu1-mesa-dev libxkbcommon-x11-0 libxcb-cursor0 | |
- name: Configure | |
run: qmake CONFIG+=${{ matrix.config }} | |
- name: Build | |
run: make -j4 | |
- name: Test | |
if: ${{ matrix.config == 'coverage' }} | |
run: xvfb-run --server-args="-screen 0 1024x768x24" ./rapcad -t test | |
- name: Coverage | |
if: ${{ matrix.config == 'coverage' }} | |
run: find . -type f -name '*.gcno' -exec gcov -p -r {} + | |
- name: Upload Coverage | |
if: ${{ matrix.config == 'coverage' }} | |
uses: codecov/codecov-action@v3 | |
windows: | |
runs-on: windows-latest | |
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_80_0 | |
ASCIIDOC: C:\asciidoc-9.1.0\ | |
MINGW: C:\mingw64\bin | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Boost | |
run: | | |
Invoke-WebRequest "https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.7z" -OutFile "$env:TEMP\boost.7z" | |
7z x -oC:\ "$env:TEMP\boost.7z" | |
- name: Cache Qt | |
id: cache-qt | |
uses: actions/cache@v3 | |
with: | |
path: ../Qt | |
key: ${{ runner.os }}-QtCache-6 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3.0.0 | |
with: | |
version: '6.5.*' | |
cache: ${{ steps.cache-qt.outputs.cache-hit }} | |
arch: win64_mingw | |
- name: Install Flex/Bison | |
if: ${{ !steps.cache-qt.outputs.cache-hit }} | |
run: | | |
Invoke-WebRequest https://github.com/lexxmark/winflexbison/releases/download/v2.5.25/win_flex_bison-2.5.25.zip -OutFile "$env:TEMP\FlexBison.zip" | |
7z x -o"$env:Qt6_DIR\bin" "$env:TEMP\FlexBison.zip" -aoa | |
- 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 | |
if: ${{ matrix.config == 'official' }} | |
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 | |
Invoke-WebRequest https://www.gnu.org/software/src-highlite/lang_files/csharp.lang -OutFile csharp.lang | |
cp 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: Configure | |
run: | | |
echo "VERSION=$(cat VERSION)" >> $env:GITHUB_ENV | |
qmake CONFIG+=${{ matrix.config }} | |
rm VERSION | |
touch version | |
- name: Build | |
run: mingw32-make -j4 -f Makefile.Release | |
- name: Clean | |
run: mingw32-make clean -f Makefile.Release | |
- name: Build documentation | |
if: ${{ matrix.config == 'official' }} | |
run: | | |
mingw32-make user_guide.html -f Makefile.Release | |
cp user_guide.html release | |
- name: Package | |
run: | | |
cp "$env:GMP\lib\libgmp-10.dll" release | |
cp "$env:GMP\lib\libmpfr-4.dll" release | |
windeployqt --no-svg --no-translations release\rapcad.exe | |
cp "$env:MINGW\libgcc_s_seh-1.dll" release | |
cp "$env:MINGW\libstdc++-6.dll" release | |
cp "$env:MINGW\libwinpthread-1.dll" release | |
- name: Build installer | |
if: ${{ matrix.config == 'official' }} | |
run: | | |
rm -Recurse release\imageformats | |
makensis installer.nsi | |
mv rapcad_setup.exe "rapcad_$($env:VERSION)_setup.exe" | |
mv release "rapcad_$env:VERSION" | |
7z a -tzip "rapcad_$env:VERSION.zip" "rapcad_$env:VERSION" | |
- name: Test | |
if: ${{ matrix.config == 'coverage' }} | |
run: .\release\rapcad.exe -t test | |
- name: Store | |
if: ${{ matrix.config == 'official' }} | |
uses: actions/upload-artifact@v3 | |
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: Cache Qt | |
id: cache-qt | |
uses: actions/cache@v3 | |
with: | |
path: ../Qt | |
key: ${{ runner.os }}-QtCache-6 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3.0.0 | |
with: | |
version: '6.5.*' | |
cache: ${{ steps.cache-qt.outputs.cache-hit }} | |
- name: Install Dependencies | |
run: | | |
brew install cgal bison | |
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 | |
- name: Configure | |
run: | | |
echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV | |
qmake CONFIG+=${{ matrix.config }} | |
rm VERSION | |
touch version | |
- name: Build | |
run: make -j4 | |
- name: Package | |
run: | | |
macdeployqt rapcad.app -dmg | |
mv rapcad.dmg rapcad_${{ env.VERSION }}.dmg | |
- name: Test | |
if: ${{ matrix.config == 'coverage' }} | |
run: ./rapcad.app/Contents/MacOS/rapcad -t test | |
- name: Store | |
if: ${{ matrix.config == 'official' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macos-artifacts | |
path: rapcad_*.dmg | |