Merge pull request #248 from pasbi/pasbi-patch-1 #773
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: Build on Windows 2019 | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: windows-2019 | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: omm | |
fetch-depth: 0 | |
- uses: ./omm/.github/actions/prepare-msys | |
- run: git clone https://gitlab.com/inkscape/lib2geom.git | |
- run: cd lib2geom; git checkout 37876ed4; cd .. | |
- run: cmake -S lib2geom | |
-B lib2geom-build | |
-DCMAKE_BUILD_TYPE=Release | |
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/dependencies | |
-G"MSYS Makefiles" | |
-D2GEOM_TESTING=OFF | |
- run: cmake --build lib2geom-build --target install --config Release -j4 | |
- run: cmake -P omm/cmake/patch_getprerequisites_module.cmake | |
- run: cmake -S omm | |
-B $GITHUB_WORKSPACE/omm-build | |
-G"MSYS Makefiles" | |
-DBUILD_TESTING=ON | |
-DCMAKE_BUILD_TYPE=Release | |
-DCMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/dependencies | |
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/omm-install | |
-DPython3_ROOT_DIR=/mingw64/bin | |
- run: echo "PYTHONPATH=$(python3 -c "import sys; print(';'.join(sys.path))")" >> $GITHUB_ENV | |
- run: echo "PYTHONHOME=$(python3 -c "import sys; print(sys.executable)")" >> GITHUB_ENV | |
- run: PYTHONPATH="${PYTHONPATH}" PYTHONHOME="${PYTHONHOME}" cmake --build $GITHUB_WORKSPACE/omm-build --target all --config Release -j4 | |
- run: cmake --build $GITHUB_WORKSPACE/omm-build --target install --config Release -j4 | |
- run: python $GITHUB_WORKSPACE/omm-build/generate-icons.py | |
- run: cmake -S omm -B $GITHUB_WORKSPACE/omm-build | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: build | |
path: | | |
omm-build | |
dependencies | |
package: | |
needs: build | |
runs-on: windows-2019 | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: omm | |
fetch-depth: 0 | |
- uses: ./omm/.github/actions/prepare-msys | |
- uses: actions/download-artifact@v2 | |
with: | |
name: build | |
- run: cmake -S omm -B $GITHUB_WORKSPACE/omm-build -DBUILD_TESTING=OFF | |
- run: cmake --build $GITHUB_WORKSPACE/omm-build --target package --config Release -j4 | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ommpfritt-installer-win2019 | |
path: omm-build/ommpfritt-*-win64.exe | |
unit-test: | |
needs: build | |
runs-on: windows-2019 | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: omm | |
- uses: ./omm/.github/actions/prepare-msys | |
- uses: actions/download-artifact@v2 | |
with: | |
name: build | |
- run: echo "PYTHONPATH=$(python3 -c "import sys; print(';'.join(sys.path))")" >> $GITHUB_ENV | |
- run: echo "PYTHONHOME=$(python3 -c "import sys; print(sys.executable)")" >> GITHUB_ENV | |
- run: PYTHONPATH="${PYTHONPATH}" PYTHONHOME="${PYTHONHOME}" ctest --test-dir $GITHUB_WORKSPACE/omm-build --output-on-failure --no-tests=error | |
release: | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
needs: package | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: ommpfritt-installer-win2019 | |
- uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "ommpfritt-*.exe" | |
allowUpdates: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
verify-package: | |
needs: package | |
runs-on: windows-2019 | |
defaults: | |
run: | |
shell: pwsh | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: ommpfritt-installer-win2019 | |
- run: ./ommpfritt-*-win64.exe /S /D=$(pwd)\install | Out-Null | |
- name: Test if application runs | |
run: if (-Not (&"$(pwd)\install\bin\ommpfritt-cli.exe" --version | Select-String ommpfritt)) { exit 1 } |