Skip to content

Commit

Permalink
ci: Add unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Senichev <[email protected]>
  • Loading branch information
artemsen committed Jul 6, 2024
1 parent 7db658d commit 5f0de27
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI
on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Update package info
run: sudo apt update
- name: Install dependencies
run: >
sudo apt install --no-install-recommends --yes
build-essential meson pkg-config wayland-protocols
libwayland-dev libjson-c-dev libxkbcommon-dev
libfreetype-dev libfontconfig-dev
libopenexr-dev libgif-dev libheif-dev libavif-dev
libjpeg-dev librsvg2-dev libtiff-dev libwebp-dev
- name: Install gtest
run: |
sudo apt install --no-install-recommends --yes libgtest-dev cmake
mkdir /tmp/gtest
cd /tmp/gtest && cmake /usr/src/gtest && make -j$(nproc)
sudo cp /tmp/gtest/lib/* /usr/lib/
- name: Check out source code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get version
run: echo "VERSION=$(git describe --tags --long --always | sed 's/^v//;s/-/./')" >> $GITHUB_OUTPUT
id: version

- name: Configure
run: meson -Dversion=${{steps.version.outputs.VERSION}} -Dtests=enabled --prefix=/usr ./build
- name: Build
run: ninja -C ./build
- name: Install
run: DESTDIR=install ninja -C ./build install
- name: Check version
run: ./build/install/usr/bin/swayimg --version
- name: Run unit tests
run: meson test --verbose -C ./build

0 comments on commit 5f0de27

Please sign in to comment.