Skip to content

test(tiledit): add some integration tests with real images #50

test(tiledit): add some integration tests with real images

test(tiledit): add some integration tests with real images #50

Workflow file for this run

name: SIRC Tiledit
# TODO: Only run when sirc-tiledit directory has changes
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
defaults:
run:
working-directory: ./sirc-tiledit
# Source: https://github.com/mesonbuild/meson/blob/master/docs/markdown/Continuous-Integration.md
jobs:
build:
name: Build and Test on ${{ matrix.os }} with Meson v${{ matrix.meson_version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04]
# TODO: Get version from .tool-versions?
meson_version: ["1.4.1"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Remove old LLVM
run: |
sudo apt-get purge clang-format-14 clang-tidy-14 clang-tools-14 clang-14 clangd-14 libc++1-14 libc++abi1-14 libclang1-14 libomp5-14 lld-14 lldb-14 llvm-14 python3-clang-14
- name: Install up-to-date LLVM
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18 all
# TODO: Surely there is an easier way to set default version
ln -s $(which clang-tidy-18) /usr/local/bin/clang-tidy
ln -s $(which clang-format-18) /usr/local/bin/clang-format
- name: Install ubuntu dependencies
run: |
sudo apt-get install catch2 libpng-dev
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.6.*
- name: Install python based dependencies
run: python -m pip install meson==${{ matrix.meson_version }} ninja gcovr
- name: Configure Project
run: |
meson setup -Db_coverage=true --buildtype debug build-debug/
meson setup --buildtype release build-release/
env:
CC: clang-18
CXX: clang++-18
- name: Compile Project (Debug)
run: |
cd build-debug
meson compile -v
- name: Test Project
run: |
cd build-debug
meson test
ninja coverage-xml
- name: Archive test coverage
uses: actions/upload-artifact@v4
with:
name: codecov-tiledit
path: ./sirc-tiledit/build-debug/meson-logs/coverage.xml
if-no-files-found: error
- name: Lint Project
run: |
cd build-debug
clang-tidy --version
ninja clang-tidy
clang-format --version
ninja clang-format-check
- name: Compile Project (Release)
run: |
cd build-release
meson compile -v
- name: Create release
run: |
cd build-release
meson dist
- name: Archive release
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: build artifacts
path: ./sirc-tiledit/build-release/meson-dist/*
if-no-files-found: error
upload-to-codecov:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: codecov-tiledit
- name: List artifacts
run: ls -la
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: coverage.xml
fail_ci_if_error: true