From b765dcdb7cfb2a0ec7e8f9a3d95b28532493f7bc Mon Sep 17 00:00:00 2001 From: Jian-Hong Pan Date: Wed, 14 Feb 2024 12:33:45 +0800 Subject: [PATCH] CI: Add build test Although the examples cannot be tested on the cloud, they still should be built without error. Signed-off-by: Jian-Hong Pan --- .github/workflows/build.yaml | 26 ++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..2256b22 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,26 @@ +name: Build + +on: + push: + branches: [master] + pull_request: + workflow_dispatch: + +jobs: + main: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Prepare + run: | + sudo apt update -y + sudo apt install --no-install-recommends gcc g++ make libgpiod-dev -y + + - name: Build + run: | + dirs=$(find ${PWD} -name libgpiod-\* -type d -maxdepth 1 -mindepth 1) + for d in $dirs; do + cd $d + make + done diff --git a/README.md b/README.md index e75a341..7caef2d 100644 --- a/README.md +++ b/README.md @@ -18,3 +18,4 @@ libgpiod introduction video: https://www.youtube.com/watch?v=76j3TIqTPTI * Pull requests are welcome * Each example should be in a folder with prefix "libgpiod-" +* Should pass the Build test