Use a minimal, statically linked AppRun when creating AppImage #306
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
compiler: | |
- g++ | |
- clang++ | |
name: Build ${{matrix.compiler}} | |
steps: | |
- name: Install minimal dependencies | |
run: | | |
sudo apt update | |
sudo apt install cmake git g++ clang pkg-config libswscale-dev libavutil-dev libdeflate-dev | |
- name: Get the Source | |
uses: actions/checkout@v3 | |
- name: Configure shell | |
run: | | |
echo "CXX=${{ matrix.compiler }}" >> $GITHUB_ENV | |
echo "CXXFLAGS=-Werror" >> $GITHUB_ENV | |
- name: Build minimal dependency timg | |
# Building a timg with all dependencies removed to the point that it | |
# can't display anything. Makes sure all the #ifdefs are there. | |
run: | | |
mkdir build-limitdep | |
cd build-limitdep | |
cmake .. -DWITH_VIDEO_DECODING=Off -DWITH_VIDEO_DEVICE=Off -DWITH_OPENSLIDE_SUPPORT=Off -DWITH_GRAPHICSMAGICK=Off -DWITH_TURBOJPEG=Off -DWITH_LIBSIXEL=Off | |
make -k | |
- name: Install Full Dependencies | |
run: | | |
sudo apt update | |
sudo apt install libgraphicsmagick++-dev | |
sudo apt install libturbojpeg-dev libexif-dev | |
sudo apt install libsixel-dev | |
sudo apt install libavcodec-dev libavformat-dev libavdevice-dev | |
sudo apt install libopenslide-dev | |
sudo apt install pandoc | |
- name: Build timg with all options enabled | |
run: | | |
mkdir build | |
cd build | |
cmake .. -DWITH_VIDEO_DECODING=On -DWITH_VIDEO_DEVICE=On -DWITH_OPENSLIDE_SUPPORT=On -DWITH_STB_IMAGE=On -DWITH_LIBSIXEL=On | |
make -k | |
AppImage: | |
runs-on: ubuntu-latest | |
name: Build AppImage | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# TODO: extract version from tag, fix-up yml file. | |
- name: Install Dependencies | |
run: | | |
sudo apt update | |
sudo apt install cmake git g++ clang pkg-config | |
sudo apt install libswscale-dev libdeflate-dev | |
sudo apt install libturbojpeg-dev libexif-dev | |
sudo apt install libsixel-dev | |
sudo apt install desktop-file-utils | |
sudo apt install libfuse2 | |
- name: Set Version | |
run: | | |
echo "PACKAGE_VERSION=$(git tag | tail -1 | sed 's/^v//')" >> $GITHUB_ENV | |
- name: Build AppDir | |
run: | | |
# Get appimagetool that is used for packaging | |
wget https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage | |
chmod +x appimagetool-x86_64.AppImage | |
export APPIMAGETOOL=./appimagetool-x86_64.AppImage | |
# Switch off some of the more expensive dependencies. | |
./.github/bin/prepare-app-image.sh \ | |
-DWITH_GRAPHICSMAGICK=Off \ | |
-DWITH_VIDEO_DECODING=Off \ | |
-DWITH_VIDEO_DEVICE=Off \ | |
-DWITH_OPENSLIDE_SUPPORT=Off \ | |
-DWITH_TURBOJPEG=On \ | |
-DWITH_STB_IMAGE=On \ | |
-DWITH_QOI_IMAGE=On \ | |
-DWITH_LIBSIXEL=On | |
- name: Show result | |
run: | | |
ls -l | |
- name: 📤 Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: timg-x86_64.AppImage | |
path: timg-x86_64.AppImage | |
# TODO: upload to release | |
CodeFormatting: | |
if: false # currently, there is no clang-format-13 in ubuntu latest | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Dependencies | |
run: | | |
sudo apt-get install clang-format-13 | |
- name: Run formatting style check | |
run: ./.github/bin/run-clang-format.sh |