Skip to content

Fix bugs

Fix bugs #310

Workflow file for this run

name: SFOAV CI
on:
push:
branches: [ "main" ]
tags: 'v*'
paths-ignore:
- 'doc/**'
- '.github/**'
workflow_dispatch:
pull_request:
jobs:
build-manual:
runs-on: ubuntu-latest
container:
image: ghcr.io/xu-cheng/texlive-full:20250101
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: apk add doxygen
- name: Build doxygen
run: |
doxygen docs/doxygen.config
(cd docs/latex; buf_size=1000000 make; ls; mv refman.pdf SimpleFastOpenAtomicVisualiser.pdf)
- name: Upload PDF
uses: actions/upload-artifact@v4
with:
name: SimpleFastOpenAtomicVisualiser.pdf
path: docs/latex/SimpleFastOpenAtomicVisualiser.pdf
linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
sudo apt-get update && sudo apt-get install -y build-essential xvfb x11-apps imagemagick xorg-dev mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev libxinerama-dev libxcursor-dev xvfb x11-apps vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
python3 -m pip install gcovr
- name: linux-linux
run: |
./build.sh -r -e --ffmpeg
mkdir linux-x86_64
cp build/sfoav/sfoav linux-x86_64/sfoav-ffmpeg-linux-x86_64
mv build/sfoav/sfoav sfoav-ffmpeg
./build.sh -t -r -e
cp build/sfoav/sfoav linux-x86_64/sfoav-linux-x86_64
mv build/sfoav/sfoav sfoav
cp LICENSE* linux-x86_64/
- name: unit tests with coverage
working-directory: ${{github.workspace}}/build
run: |
make ctest_coverage
- name: Generate summary
id: summary
run: |
{
echo 'SUMMARY<<EOF'
echo "\`\`\`"
cat build/cov.txt
echo "\`\`\`"
echo EOF
} >> "$GITHUB_ENV"
cat build/cov.txt
- name: Notify coverage
uses: actions/github-script@v7
if: github.event_name == 'pull_request'
with:
github-token: ${{ secrets.BURROW_BOT }}
script: |
const { SUMMARY } = process.env
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `${SUMMARY}`
})
- name: mesh rendering test
run: |
cd build
export DISPLAY=:99
sudo Xvfb :99 -screen 0 512x512x24 &
sleep 5
MESA_GL_VERSION_OVERRIDE=3.3 ./sfoav_models_test &
export PID=$!
sleep 10
xwd -root -silent | convert xwd:- png:screenshot-meshes.png
sleep 5 && kill -9 $PID
sudo pkill Xvfb
- name: jo_mpeg video test
run: |
export DISPLAY=:99
sudo Xvfb :99 -screen 0 512x512x24 &
sleep 5
MESA_GL_VERSION_OVERRIDE=3.3 ./sfoav tests/test_structure_input/HISTORY -script tests/video.lua &
export PID=$!
sleep 10 && kill -9 $PID
sudo pkill Xvfb
mkdir jo_mpeg
mv *.mp4 jo_mpeg/jo_mpeg.mp4
- name: ffmpeg video test
run: |
export DISPLAY=:99
sudo Xvfb :99 -screen 0 512x512x24 &
MESA_GL_VERSION_OVERRIDE=3.3 ./sfoav-ffmpeg tests/test_structure_input/HISTORY -script tests/video.lua &
export PID=$!
sleep 10 && kill -9 $PID
sudo pkill Xvfb
mkdir ffmpeg
mv *.mp4 ffmpeg/ffmpeg.mp4
- name: upload screenshots
uses: actions/upload-artifact@v4
with:
name: screenshots
path: build/screenshot-meshes.png
- name: upload ffmpeg video
uses: actions/upload-artifact@v4
with:
name: ffmpeg
path: ffmpeg/ffmpeg.mp4
- name: upload jo_mpeg video
uses: actions/upload-artifact@v4
with:
name: jo_mpeg
path: jo_mpeg/jo_mpeg.mp4
- name: build artifact
uses: actions/upload-artifact@v4
with:
name: linux-x86_64
path: linux-x86_64
windows:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y xorg-dev build-essential mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev g++-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix libxinerama-dev libxcursor-dev vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools
- name: linux-X-windows
run: |
./build.sh -t -w -r -e
mkdir windows
cp build/sfoav/sfoav.exe windows/sfoav-windows.exe
cp build/*.dll windows/
cp LICENSE* windows/
- name: unit tests
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure
- name: build artifact
uses: actions/upload-artifact@v4
with:
name: windows
path: windows
macos:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
wget https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.zip -O vulkan-sdk.zip
unzip vulkan-sdk.zip
binary=`ls *vulkansdk-macOS-*.app/Contents/MacOS/*`
sudo ${binary} --root ~/vulkan --accept-licenses --default-answer --confirm-command install
ls ~/vulkan
cd ~/vulkan/
python install_vulkan.py
- name: macos-macos
run: |
./build.sh -o -e -r -t
mkdir macos
cp build/sfoav/sfoav macos/sfoav-macos
cp LICENSE* macos/
- name: unit tests
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure
- name: build artifact
uses: actions/upload-artifact@v4
with:
name: macos
path: macos
release:
needs: [linux, windows, macos, build-manual]
if: github.ref_type == 'tag'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: get linux build
uses: actions/download-artifact@v4
with:
name: linux-x86_64
- name: get windows build
uses: actions/download-artifact@v4
with:
name: windows
- name: get macos build
uses: actions/download-artifact@v4
with:
name: macos
- name: get manual
uses: actions/download-artifact@v4
with:
name: SimpleFastOpenAtomicVisualiser.pdf
- name: pack
run: |
ls
for release in linux-x86_64 macos windows;
do
mkdir $release
mv sfoav*-$release* $release/
cp LICENSE* $release/
cp README.md $release/
cp SimpleFastOpenAtomicVisualiser.pdf $release
zip -r $release.zip $release/*
done
# https://github.com/softprops/action-gh-release
- name: release
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: true
name: "release-${{ github.ref_name }}"
tag_name: ${{ github.ref }}
files: |
linux-x86_64.zip
windows.zip
macos.zip