Skip to content

Use MSVC to build Win artifacts #257

Use MSVC to build Win artifacts

Use MSVC to build Win artifacts #257

Workflow file for this run

name: Build
on:
push:
branches-ignore:
- gh-pages
schedule:
- cron: '0 0 * * 0'
pull_request:
workflow_dispatch:
jobs:
debug:
name: 'Test & Debug (Linux)'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.8.0'
target: 'desktop'
cache: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libgl1-mesa-dev libxkbcommon-x11-0 libxcb-icccm4 libxcb-xinerama0 libxcb-xkb1 libxcb-render-util0 libxcb-keysyms1 libxcb-image0 libxcb-cursor0 gcovr
- name: Configure
run: cmake -GNinja -DVIPSTER_DESKTOP=ON -DPython3_ROOT_DIR=${pythonLocation} -DVIPSTER_PYWIDGET=ON -DVIPSTER_LAMMPS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage" -B build
- name: Build
run: cmake --build build
- name: Test
run: |
cd build
ctest --output-on-failure
- name: Generate XML Coverage
run: gcovr -f vipster -x -o coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage.xml
release:
name: 'Build @ ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
script: make-appimage.sh
artifact: Vipster-Linux-x86_64.AppImage
qt_arch: linux_gcc_64
- os: windows-latest
script: make-win-archive.sh
artifact: Vipster-Win-x86_64.zip
qt_arch: win64_msvc2022_64
#- os: macOS-latest
# script: make-macos-app.sh
# artifact: Vipster-macOS-x86_64.dmg
# qt_arch: clang_64
needs: debug
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ilammy/msvc-dev-cmd@v1
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Add Python libraries
run: pip install numpy moltemplate
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.8.0'
target: 'desktop'
arch: ${{ matrix.qt_arch }}
dir: ${{ github.workspace }}
cache: true
- name: Configure Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install libgl1-mesa-dev libxkbcommon-x11-0 libxcb-icccm4 libxcb-xinerama0 libxcb-xkb1 libxcb-render-util0 libxcb-keysyms1 libxcb-image0 libxcb-cursor0 fuse
- name: Configure
run: cmake -GNinja -DVIPSTER_DESKTOP=ON -DPython3_ROOT_DIR=${pythonLocation} -DVIPSTER_PYWIDGET=ON -DVIPSTER_LAMMPS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -B build
- name: Build
run: cmake --build build
- name: Test
run: |
cd build
ctest --output-on-failure
- name: Bundle artifact
run: |
cd build
. ../util/${{ matrix.script }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Vipster-${{ runner.os }}
path: build/${{ matrix.artifact }}
web:
name: 'WebVipster'
runs-on: ubuntu-latest
needs: debug
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- uses: mymindstorm/setup-emsdk@v14
with:
version: latest
- name: Build
run: npm run prepare
- name: Bundle artifact
run: |
ARTIFACT=$(npm pack | tail -1)
echo "ARTIFACT=$ARTIFACT" >> $GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Vipster-Web
path: ${{ env.ARTIFACT }}
wheels:
name: 'Python Wheels'
runs-on: ${{ matrix.os }}
needs: [release, web]
strategy:
matrix:
os: [windows-latest, ubuntu-22.04]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
include:
- os: windows-latest
wheeldir: dist
- os: ubuntu-22.04
wheeldir: wheelhouse
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build wheel
run: |
pip install setuptools wheel cmake
python setup.py bdist_wheel
- name: Fix Manylinux
if: runner.os == 'Linux'
run: |
pip install auditwheel
auditwheel repair dist/*.whl --plat manylinux_2_35_x86_64
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Vipster-Python-${{ matrix.python-version }}-${{ runner.os }}
path: ${{ matrix.wheeldir }}/*.whl