Skip to content

Commit

Permalink
Update tooling and add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
glesica committed Nov 16, 2021
1 parent f922d9d commit fc0c426
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and Test

on: [push, pull_request]

jobs:
check-build:
runs-on: ubuntu-20.04
container:
image: traviswheelerlab/awfmindex-build
volumes:
- ${{ github.workspace }}:/code
steps:
- uses: actions/checkout@v1
- run: cmake . && make

check-legacy-build:
runs-on: ubuntu-20.04
container:
image: traviswheelerlab/awfmindex-build
volumes:
- ${{ github.workspace }}:/code
steps:
- uses: actions/checkout@v1
- run: make -f Makefile_legacy && make -f Makefile_legacy static

check-format:
runs-on: ubuntu-20.04
container:
image: traviswheelerlab/awfmindex-build
volumes:
- ${{ github.workspace }}:/code
steps:
- uses: actions/checkout@v1
- run: ./tool/check-format.sh
11 changes: 11 additions & 0 deletions Dockerfile_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM debian:bullseye-slim

RUN apt-get update && apt-get -y install \
build-essential \
clang-format \
cmake \
git \
&& rm -rf /var/lib/apt/lists/*

VOLUME [ "/code" ]
WORKDIR /code
8 changes: 8 additions & 0 deletions tool/build-builder-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env sh

set -e

docker build -f Dockerfile_build \
-t traviswheelerlab/awfmindex-build:latest \
$@ \
.
8 changes: 8 additions & 0 deletions tool/check-format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env sh

set -e

C_FILES=$(find src -type f -name '*.c')
H_FILES=$(find src -type f -name '*.h')

clang-format --dry-run --Werror ${C_FILES} ${H_FILES}
5 changes: 5 additions & 0 deletions tool/push-builder-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh

set -e

docker push traviswheelerlab/awfmindex-build:latest
8 changes: 8 additions & 0 deletions tool/run-format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env sh

set -e

C_FILES=$(find src -type f -name '*.c')
H_FILES=$(find src -type f -name '*.h')

clang-format -i ${C_FILES} ${H_FILES}

0 comments on commit fc0c426

Please sign in to comment.