diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 00000000..7ab9e8f9 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,33 @@ +name: CI + +on: [pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-22.04, ubuntu-24.04, ubuntu-26.04] + + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Update APT cache + run: sudo apt-get update --quiet + + - name: Install dependencies + run: sudo apt-get install --yes valac libglib2.0-bin libglib2.0-dev libsoup2.4-dev libfcgi-dev valgrind ninja-build meson + + - name: Build + run: | + mkdir build + meson . build + ninja -C build -v + + - name: Test + run: | + meson test -C build --wrapper valgrind --print-errorlogs --num-processes=1 -v + DESTDIR=$(mktemp -d) ninja -C build -v install + diff --git a/src/vsgi-multipart-input-stream.vala b/src/vsgi-multipart-input-stream.vala index a1e88698..5a337ac7 100644 --- a/src/vsgi-multipart-input-stream.vala +++ b/src/vsgi-multipart-input-stream.vala @@ -18,7 +18,7 @@ using GLib; #if HAVE_MEMMEM -private extern void* memmem (uint8[] haystack, uint8[] needle); +private extern void* memmem ([CCode(type = "const void*", array_length_type = "size_t")] uint8[] haystack, [CCode(type = "const void*", array_length_type = "size_t")] uint8[] needle); #else private void* memmem (uint8[] haystack, uint8[] needle) { for (var i = 0; i < haystack.length - needle.length + 1; i++) { diff --git a/src/vsgi-server.vala b/src/vsgi-server.vala index 66b01844..543f8757 100644 --- a/src/vsgi-server.vala +++ b/src/vsgi-server.vala @@ -19,6 +19,9 @@ using GLib; namespace VSGI { + [CCode (cname = "vsgi_server_construct")] + public extern unowned Server server_construct (GLib.Type object_type); + /** * Server that feeds a {@link VSGI.Handler} with incoming requests. *