commit:     cb63ad4fb4b8a21b269f330f2512da0a6ce7399e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  6 06:58:34 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jan  6 07:05:14 2023 +0000
URL:        https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=cb63ad4f

CI: add Github Actions

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .github/workflows/build-test-ci.yml | 58 +++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/.github/workflows/build-test-ci.yml 
b/.github/workflows/build-test-ci.yml
new file mode 100644
index 0000000..7ad056b
--- /dev/null
+++ b/.github/workflows/build-test-ci.yml
@@ -0,0 +1,58 @@
+# GitHub actions workflow.
+# 
https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
+
+name: Build+Test CI
+
+#on:
+#  push:
+#    branches: [master, gh-actions]
+#    tags: [v*]
+#  pull_request:
+#    types: [created, opened, edited, push]
+
+on: [pull_request, push]
+
+jobs:
+  make:
+    strategy:
+      matrix:
+        os: [ubuntu-latest]
+        cc: [gcc, clang]
+        sanitize: [none] # [none, asan, ubsan]
+      fail-fast: false
+    runs-on: ${{ matrix.os }}
+    env:
+      CC: ${{ matrix.cc }}
+      SANITIZER: ${{ matrix.sanitize }}
+      UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
+    steps:
+    - name: Install dependencies
+      run: |
+        sudo apt-get update -qq
+        sudo apt-get install build-essential gcc clang automake autoconf 
autoconf-archive libtool pax-utils -qy
+
+        case "$SANITIZER" in
+          none)
+             ;;
+          asan)
+             echo CFLAGS="-O2 -ggdb3 -fsanitize=address" >> $GITHUB_ENV
+             echo CXXFLAGS="-O2 -ggdb3 -fsanitize=address" >> $GITHUB_ENV
+             echo LDFLAGS="-fsanitize=address" >> $GITHUB_ENV
+             ;;
+          ubsan)
+             echo CFLAGS="-O2 -ggdb3 -fsanitize=undefined" >> $GITHUB_ENV
+             echo CXXFLAGS="-O2 -ggdb3 -fsanitize=undefined" >> $GITHUB_ENV
+             echo LDFLAGS="-fsanitize=undefined" >> $GITHUB_ENV
+             ;;
+        esac
+
+    - uses: actions/checkout@v3
+      name: Checkout
+
+    - name: Build
+      run: |
+        ./autogen.sh
+        ./configure || cat config.log
+        make V=1
+        make V=1 check
+        make V=1 distcheck

Reply via email to