First Undo mechanism draft #272
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: | |
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_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@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: Add Python libraries | |
shell: bash | |
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: Cache MinGW | |
if: runner.os == 'Windows' | |
id: cache-mingw | |
uses: actions/cache@v4 | |
with: | |
path: MinGW | |
key: mingw-19.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-19.0.exe | |
7z x mingw-19.0.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 libxcb-cursor0 fuse | |
- 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@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: Cache MinGW | |
if: runner.os == 'Windows' | |
id: cache-mingw | |
uses: actions/cache@v4 | |
with: | |
path: MinGW | |
key: mingw-19.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-19.0.exe | |
7z x mingw-19.0.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@v5 | |
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 | |
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 |