Browse Source

Switch from Travis to GitHub Actions

pull/318/head
Michael Stapelberg 9 months ago
committed by Michael Stapelberg
parent
commit
21380d9a39
  1. 34
      .github/workflows/main.yml
  2. 13
      .travis.yml
  3. 4
      travis/Dockerfile

34
.github/workflows/main.yml

@ -0,0 +1,34 @@
name: GitHub Actions
on:
push:
pull_request:
jobs:
build:
name: build and test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
env:
CC: ${{ matrix.compiler }}
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- name: fetch or build Docker container
run: |
docker build --pull --no-cache --rm -t=i3lock -f travis/Dockerfile .
docker run -e CC -v $PWD:/usr/src:rw i3lock /bin/sh -c 'git config --global --add safe.directory /usr/src && mkdir build && cd build && CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror" meson .. && ninja'
formatting:
name: Check formatting
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get install -y clang-format-11
- name: Check formatting
run: clang-format-11 --dry-run --Werror $(git ls-files '*.c' 'include/*.h')

13
.travis.yml

@ -1,13 +0,0 @@
# Use Ubuntu 14.04 (trusty), as per http://blog.travis-ci.com/2015-10-14-opening-up-ubuntu-trusty-beta/
sudo: false
dist: trusty
services:
- docker
language: c
compiler:
- gcc
- clang
script:
- docker build --pull --no-cache --rm -t=i3lock -f travis/Dockerfile .
- docker run -e CC=$CC -v $PWD:/usr/src:rw i3lock /bin/sh -c 'clang-format-9 -i *.[ch] && git diff --exit-code || (echo "Code was not formatted using clang-format!"; false)'
- docker run -e CC=$CC -v $PWD:/usr/src:rw i3lock /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j V=1 CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror"'

4
travis/Dockerfile

@ -16,10 +16,10 @@ RUN echo 'APT::Acquire::Retries "5";' > /etc/apt/apt.conf.d/80retry
# test suite dependencies (for running tests)
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential clang git autoconf automake libxcb-randr0-dev pkg-config libpam0g-dev \
build-essential clang git meson libxcb-randr0-dev pkg-config libpam0g-dev \
libcairo2-dev libxcb1-dev libxcb-dpms0-dev libxcb-image0-dev libxcb-util0-dev \
libxcb-xrm-dev libev-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev \
libxkbcommon-x11-dev clang-format-9 && \
libxkbcommon-x11-dev && \
rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src

Loading…
Cancel
Save