Skip to content

Commit

Permalink
Add CI support using Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanma committed Dec 13, 2024
1 parent 038838c commit 031f4e7
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ARG BASE_IMAGE=gcc:13-bookworm
FROM $BASE_IMAGE

RUN set -xe \
&& apt-get update \
&& apt-get install -y cmake

RUN set -xe \
&& cd /tmp \
&& wget https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz \
&& tar xzf eigen-3.4.0.tar.gz \
&& cd eigen-3.4.0 \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make install \
&& cd ../.. \
&& rm -rf eigen-3.4.0.tar.gz eigen-3.4.0
54 changes: 54 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build
run-name: Build and test of commit "${{ github.event.head_commit.message }}"

on:
push:
branches:
- "*"

jobs:
build:
name: Build

runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
compiler: [
"gcc:10-bullseye",
"gcc:11-bullseye",
"gcc:12-bullseye",
"gcc:13-bookworm",
"silkeh/clang:13-bullseye",
"silkeh/clang:14-bullseye",
"silkeh/clang:15-bullseye",
"silkeh/clang:16-bullseye"
]

steps:
- uses: actions/checkout@v4

- name: Set reusable strings
id: strings
shell: bash
run: |
IMAGE_NAME=$(echo "${{ matrix.compiler }}" | sed 's/silkeh\///g')
echo "IMAGE_NAME=gafro-$IMAGE_NAME" >> "$GITHUB_OUTPUT"
- name: Build the Docker image
run: |
docker build . --build-arg BASE_IMAGE="${{ matrix.compiler }}" --file .github/docker/Dockerfile --tag ${{ steps.strings.outputs.IMAGE_NAME }}
- name: Run the build process with Docker
uses: addnab/docker-run-action@v3
with:
image: ${{ steps.strings.outputs.IMAGE_NAME }}
options: -v ${{ github.workspace }}:/opt/gafro
run: |
cd /opt/gafro
mkdir build
cd build
cmake ..
make install

0 comments on commit 031f4e7

Please sign in to comment.