forked from drath/libratbag
Add a GitHub Workflow as CI run (#1238)
CircleCI is limiting how many runs we can do, which results in pipelines randomly failing when we've used up the credits for this month. Let's add a github workflow instead. Unfortunately github workflows are a bit of a toy api, no support for YAML anchors or extending other jobs, so there's a lot of duplication needed to get a job to do something. The actions added in this patch help a bit to make the jobs easier to understand (copied from libwacom). This only runs on Ubuntu right now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
47
.github/workflows/main.yml
vendored
Normal file
47
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
name: linux
|
||||
|
||||
on: [ push, pull_request ]
|
||||
|
||||
env:
|
||||
UBUNTU_DEP_BUILD: gcc g++ pkg-config systemd libevdev-dev libglib2.0-dev libjson-glib-dev libsystemd-dev libudev-dev libunistring-dev python3-dev python3-evdev swig
|
||||
UBUNTU_DEP_TEST: check python3-gi python3-lxml valgrind
|
||||
PIP_PACKAGES: meson ninja libevdev pyudev pytest
|
||||
|
||||
jobs:
|
||||
build-and-dist:
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
meson_args:
|
||||
- ''
|
||||
- '-Dbuildtype=plain'
|
||||
- '-Dbuildtype=release'
|
||||
- '-Ddocumentation=true'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ./.github/actions/pkginstall
|
||||
with:
|
||||
apt: $UBUNTU_DEP_BUILD $UBUNTU_DEP_TEST
|
||||
pip: $PIP_PACKAGES
|
||||
- name: meson test ${{matrix.meson_options}}
|
||||
uses: ./.github/actions/meson
|
||||
with:
|
||||
meson_args: --prefix=$PWD/_instdir ${{matrix.meson_options}}
|
||||
ninja_args: install
|
||||
- name: check installation of data files
|
||||
run: diff -u <(cd data/devices; ls *.device) <(cd _instdir/share/libratbag; ls *.device)
|
||||
- name: ninja uninstall
|
||||
uses: ./.github/actions/meson
|
||||
with:
|
||||
meson_args: --prefix=$PWD/_instdir
|
||||
ninja_args: uninstall
|
||||
- name: check if any files are left after uninstall
|
||||
run: (test -d _instdir && tree _instdir && exit 1) || exit 0
|
||||
# Capture all the meson logs, even if we failed
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: ${{ always() }} # even if we fail
|
||||
with:
|
||||
name: meson test logs
|
||||
path: |
|
||||
builddir/meson-logs/testlog*.txt
|
||||
builddir/meson-logs/meson-log.txt
|
||||
Reference in New Issue
Block a user