ci: build datum inside the CI

As this could be a potential spam point for our GitHub because
people might submit code without verifying if it compiles.

However, having this inside the CI allows us to cover a basic compilation
test, which for some contributions may not require a full build. Additionally,
we can ensure that the code compiles on basic Linux OS environments, like Ubuntu,
or detect if there are any dependency breaks (even with minimal dependencies,
so this shouldn't be an issue either).

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
This commit is contained in:
Vincenzo Palazzo 2024-10-19 12:02:04 +01:00
parent c8cb0da63d
commit 25e72324b9
No known key found for this signature in database
GPG Key ID: 8B6DC2B870B80D5F

31
.github/workflows/build.yaml vendored Normal file
View File

@ -0,0 +1,31 @@
name: Build DATUM Gateway
on:
schedule:
- cron: '0 0 1 * *'
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create build directory
run: mkdir -p build
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev libjansson-dev libmicrohttpd-dev libsodium-dev
- name: Build DATUM Gateway
run: |
cd build
cmake ..
make -j$(nproc)