summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorJason Gerecke <jason.gerecke@wacom.com>2021-01-15 11:35:30 -0800
committerJason Gerecke <killertofu@gmail.com>2021-02-01 11:09:33 -0800
commit065aec968f7a89dd74987b8eb50ab4615f0c4347 (patch)
treeb9e75757b060500df67aa89ac11eb07eb6f80bf3 /.github
parentd56107e19a57bf3cf44e266a394da43397a8841a (diff)
downloadxf86-input-wacom-065aec968f7a89dd74987b8eb50ab4615f0c4347.tar.gz
Add workflow for automated testing via Github Actions
We've been using Travis for our automated tests, but that service is becoming more difficult to use (open source projects have to periodically request free credits to keep running). Github itself can be used as a replacement by using its "Actions" infrastructure to execute various defined workflows. This commit ports the Travis script into Github syntax. Most everything was translated without issue, but support for the ppc64le architecture is notably missing. This is not a critical target for us, however, so we ignore it for the time being. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/coverity.yml47
-rw-r--r--.github/workflows/main.yml47
2 files changed, 94 insertions, 0 deletions
diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
new file mode 100644
index 0000000..a239c31
--- /dev/null
+++ b/.github/workflows/coverity.yml
@@ -0,0 +1,47 @@
+on:
+ schedule:
+ - cron: '0 0 1,15 * *'
+ workflow_dispatch:
+
+env:
+ COVERITY_SCAN_PROJECT_NAME: linuxwacom/xf86-input-wacom
+ COVERITY_SCAN_NOTIFICATION_EMAIL: killertofu@gmail.com
+ COVERITY_SCAN_BUILD_COMMAND_PREPEND:
+ COVERITY_SCAN_BUILD_COMMAND: make
+ COVERITY_SCAN_BRANCH_PATTERN: .*
+ COVERITY_URL: https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh
+ COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
+
+jobs:
+ coverity:
+ runs-on: ubuntu-20.04
+ environment: coverity
+ steps:
+ - name: Checkout the repo
+ uses: actions/checkout@v2
+
+ - name: Set up build environment / dependencies
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y --no-install-recommends \
+ xutils-dev xserver-xorg-dev libx11-dev libxi-dev \
+ libxrandr-dev libxinerama-dev libudev-dev
+ mkdir _build
+
+ - name: Coverity download
+ run: |
+ curl -fs "$COVERITY_URL" > coverity.sh
+ sed -i 's/"$status_code" != "201"/"$status_code" -lt 200 -o "$status_code" -ge 300/' coverity.sh
+ chmod +x coverity.sh
+
+ - name: Coverity build / upload
+ run: |
+ pushd _build > /dev/null
+ # We don't want our CFLAGS (especially -Werror) to apply at `configure`
+ # time so short-circuit our environment at that moment and provide the
+ # flags to `make` instead. Not doing so results in an incorrect config:
+ # 'checking for rint in -lm... no' because of a builtin-declaration-mismatch
+ # warning (error) in the auto-generated feature test.
+ CFLAGS="" ../autogen.sh --disable-silent-rules
+ bash ../coverity.sh
+ popd > /dev/null
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000..012e08f
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,47 @@
+on: [ push, pull_request ]
+
+env:
+ CFLAGS: -Werror -Wall -Wextra -Wno-error=sign-compare -Wno-error=unused-parameter
+
+jobs:
+ compile:
+ runs-on: ubuntu-20.04
+ strategy:
+ matrix:
+ compiler: [ gcc, clang ]
+ steps:
+ - name: Checkout the repo
+ uses: actions/checkout@v2
+
+ - name: Set up build environment / dependencies
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y --no-install-recommends \
+ xutils-dev xserver-xorg-dev libx11-dev libxi-dev \
+ libxrandr-dev libxinerama-dev libudev-dev \
+ ${{ matrix.compiler }}
+ mkdir _build
+
+ - name: Build the driver
+ run: |
+ pushd _build > /dev/null
+ # We don't want our CFLAGS (especially -Werror) to apply at `configure`
+ # time so short-circuit our environment at that moment and provide the
+ # flags to `make` instead. Not doing so results in an incorrect config:
+ # 'checking for rint in -lm... no' because of a builtin-declaration-mismatch
+ # warning (error) in the auto-generated feature test.
+ CFLAGS="" CC="${{ matrix.compiler }}" ../autogen.sh --disable-silent-rules
+ make CFLAGS="$CFLAGS"
+ popd > /dev/null
+
+ - name: Run unit tests
+ run: |
+ pushd _build > /dev/null
+ make check || (cat **/test-suite.log && false)
+ popd > /dev/null
+
+ - name: Run distcheck
+ run: |
+ pushd _build > /dev/null
+ make distcheck
+ popd > /dev/null