summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2021-04-18 12:39:38 +0100
committerSimon McVittie <smcv@collabora.com>2021-04-18 13:41:11 +0100
commitbe95ff6156338b0096abd6648eff720a8bc97dc5 (patch)
tree7aed7324971ec775500bc748fb2f674805fa4a6f /.github
parent4d948dc5566e12033cb2ca737e7c56fe7e1b702d (diff)
downloadbubblewrap-be95ff6156338b0096abd6648eff720a8bc97dc5.tar.gz
Add CI using Github workflows
Loosely based on the configuration used in Flatpak. Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/block-autosquash-commits.yml15
-rw-r--r--.github/workflows/check.yml94
2 files changed, 109 insertions, 0 deletions
diff --git a/.github/workflows/block-autosquash-commits.yml b/.github/workflows/block-autosquash-commits.yml
new file mode 100644
index 0000000..43d6771
--- /dev/null
+++ b/.github/workflows/block-autosquash-commits.yml
@@ -0,0 +1,15 @@
+on: pull_request
+
+name: Pull Requests
+
+jobs:
+ message-check:
+ name: Block Autosquash Commits
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Block Autosquash Commits
+ uses: xt0rted/block-autosquash-commits-action@v2.0.0
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
new file mode 100644
index 0000000..c217381
--- /dev/null
+++ b/.github/workflows/check.yml
@@ -0,0 +1,94 @@
+name: CI checks
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ check:
+ name: Build with gcc and test
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out
+ uses: actions/checkout@v1
+ - name: Install build-dependencies
+ run: sudo ./ci/builddeps.sh
+ - name: Create logs dir
+ run: mkdir test-logs
+ - name: autogen.sh
+ run: NOCONFIGURE=1 ./autogen.sh
+ - name: configure
+ run: |
+ mkdir _build
+ pushd _build
+ ../configure \
+ --enable-man \
+ --enable-selinux \
+ ${NULL+}
+ popd
+ env:
+ CFLAGS: >-
+ -O2
+ -Wp,-D_FORTIFY_SOURCE=2
+ -fsanitize=address
+ -fsanitize=undefined
+ - name: make
+ run: make -C _build -j $(getconf _NPROCESSORS_ONLN) V=1
+ - name: smoke-test
+ run: |
+ set -x
+ ./_build/bwrap --bind / / --tmpfs /tmp true
+ env:
+ ASAN_OPTIONS: detect_leaks=0
+ - name: check
+ run: |
+ make -C _build -j $(getconf _NPROCESSORS_ONLN) check VERBOSE=1 BWRAP_MUST_WORK=1
+ env:
+ ASAN_OPTIONS: detect_leaks=0
+ - name: Collect overall test logs on failure
+ if: failure()
+ run: mv _build/test-suite.log test-logs/ || true
+ - name: Collect individual test logs on cancel
+ if: failure() || cancelled()
+ run: mv _build/tests/*.log test-logs/ || true
+ - name: Upload test logs
+ uses: actions/upload-artifact@v1
+ if: failure() || cancelled()
+ with:
+ name: test logs
+ path: test-logs
+
+ clang:
+ name: Build with clang and analyze
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ language:
+ - cpp
+ steps:
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v1
+ with:
+ languages: ${{ matrix.language }}
+ - name: Check out
+ uses: actions/checkout@v1
+ - name: Install build-dependencies
+ run: sudo ./ci/builddeps.sh --clang
+ - name: autogen.sh
+ run: NOCONFIGURE=1 ./autogen.sh
+ - name: configure
+ run: ./configure --enable-selinux
+ env:
+ CC: clang
+ CFLAGS: >-
+ -O2
+ -Werror=unused-variable
+ - name: make
+ run: make -j $(getconf _NPROCESSORS_ONLN) V=1
+ - name: CodeQL analysis
+ uses: github/codeql-action/analyze@v1