Skip to content

Build

Build #236

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-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.4.0'
target: 'desktop'
cached: 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 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-20.04
script: make-appimage.sh
artifact: Vipster-Linux-x86_64.AppImage
qt_arch: gcc_64
- os: windows-latest
script: make-win-archive.sh
artifact: Vipster-Win-x86_64.zip
qt_arch: win64_mingw
#- os: macOS-latest
# script: make-macos-app.sh
# artifact: Vipster-macOS-x86_64.dmg
# qt_arch: clang_64
needs: debug
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Add Python libraries
shell: bash
run: pip install numpy moltemplate
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.4.0'
target: 'desktop'
arch: ${{ matrix.qt_arch }}
dir: ${{ github.workspace }}
cached: true
- name: Cache MinGW
if: runner.os == 'Windows'
id: cache-mingw
uses: actions/cache@v3
with:
path: MinGW
key: mingw-18.0
- name: Install MinGW
if: (runner.os == 'Windows') && (steps.cache-mingw.outputs.cache-hit != 'true')
shell: bash
run: |
choco install wget -y --no-progress
wget https://nuwen.net/files/mingw/mingw-18.0-without-git.exe
7z x mingw-18.0-without-git.exe
MinGW/set_distro_paths.bat
- name: Configure MinGW
if: runner.os == 'Windows'
shell: bash
run: |
echo $GITHUB_WORKSPACE/MinGW/bin >> $GITHUB_PATH
echo CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/MinGW:$CMAKE_PREFIX_PATH >> $GITHUB_ENV
- name: Configure Linux
if: runner.os == 'Linux'
shell: bash
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
- name: Configure
shell: bash
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
shell: bash
run: cmake --build build
- name: Test
shell: bash
run: |
cd build
ctest --output-on-failure
- name: Bundle artifact
shell: bash
run: |
cd build
. ../util/${{ matrix.script }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Vipster-${{ runner.os }}
path: build/${{ matrix.artifact }}
web:
name: 'WebVipster'
runs-on: ubuntu-latest
needs: debug
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: mymindstorm/setup-emsdk@v7
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@v3
with:
name: Vipster-Web
path: ${{ env.ARTIFACT }}
wheels:
name: 'Python Wheels'
runs-on: ${{ matrix.os }}
needs: [release, web]
strategy:
matrix:
os: [windows-latest, ubuntu-20.04]
python-version: ['3.8', '3.9', '3.10', '3.11']
include:
- os: windows-latest
wheeldir: dist
- os: ubuntu-20.04
wheeldir: wheelhouse
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Cache MinGW
if: runner.os == 'Windows'
id: cache-mingw
uses: actions/cache@v3
with:
path: MinGW
key: mingw-18.0
- name: Install MinGW
if: (runner.os == 'Windows') && (steps.cache-mingw.outputs.cache-hit != 'true')
shell: bash
run: |
choco install wget -y --no-progress
wget https://nuwen.net/files/mingw/mingw-18.0-without-git.exe
7z x mingw-18.0-without-git.exe
MinGW/set_distro_paths.bat
- name: Configure MinGW
if: runner.os == 'Windows'
shell: bash
run: |
echo $GITHUB_WORKSPACE/MinGW/bin >> $GITHUB_PATH
echo CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/MinGW:$CMAKE_PREFIX_PATH >> $GITHUB_ENV
echo CMAKE_GENERATOR="MSYS Makefiles" >> $GITHUB_ENV
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Build wheel
shell: bash
run: |
pip install setuptools wheel cmake
python setup.py bdist_wheel
- name: Fix Manylinux
if: runner.os == 'Linux'
shell: bash
run: |
pip install auditwheel==5.1.2
auditwheel repair dist/*.whl --plat manylinux_2_31_x86_64
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Vipster-PyWheel-${{ runner.os }}
path: ${{ matrix.wheeldir }}/*.whl