Skip to content

Commit

Permalink
ci: add packing job
Browse files Browse the repository at this point in the history
  • Loading branch information
Kola50011 committed Sep 23, 2024
1 parent 1791063 commit 3836d14
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.github
ci
ci/Dockerfile
38 changes: 0 additions & 38 deletions .github/workflows/ci.yaml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Package

on:
push:

jobs:
package:
runs-on: ubuntu-24.04
strategy:
matrix:
platform: [linux/arm64/v8]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/arm64

- name: Prepare container
run: docker buildx build -f ci/Dockerfile . -t libcreate --platform ${{ matrix.platform }} --load
- name: Build
run: docker run --platform ${{ matrix.platform }} -v ./output:/libcreate/_packages libcreate
30 changes: 30 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and test

on:
push:
branches: ["master"]
pull_request:

env:
BUILD_TYPE: Release

jobs:
test:
runs-on: ubuntu-24.04

steps:
- name: Install dependencies
run: |
sudo apt install build-essential cmake git libboost-system-dev libboost-thread-dev file libgtest-dev googletest
- uses: actions/checkout@v4

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_FLAGS="-Werror"

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
7 changes: 2 additions & 5 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM ubuntu:24.04

RUN apt update && \
apt install -y \
build-essential cmake file \
build-essential cmake git file \
libboost-system-dev libboost-thread-dev \
libgtest-dev googletest && \
rm -rf /var/lib/apt/lists/*
Expand All @@ -11,7 +11,4 @@ WORKDIR /libcreate
COPY . .

WORKDIR /libcreate/build
RUN cmake -B /libcreate/build -S /libcreate -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Werror" && \
cmake --build /libcreate/build --config Release && \
ctest -C Release --output-on-failure && \
cpack --build /libcreate/build -G DEB
ENTRYPOINT ["/bin/bash", "/libcreate/ci/entrypoint.sh"]
10 changes: 10 additions & 0 deletions ci/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

cmake -B /libcreate/build -S /libcreate -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS='-Werror'
cmake --build /libcreate/build --config Release
ctest -C Release --output-on-failure
cpack --build /libcreate/build -G DEB

0 comments on commit 3836d14

Please sign in to comment.