ci: add packing job
This commit is contained in:
parent
1791063fa8
commit
3836d1480b
6 changed files with 72 additions and 44 deletions
|
@ -1,2 +1,2 @@
|
|||
.github
|
||||
ci
|
||||
ci/Dockerfile
|
38
.github/workflows/ci.yaml
vendored
38
.github/workflows/ci.yaml
vendored
|
@ -1,38 +0,0 @@
|
|||
name: Build and test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['master']
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
BUILD_TYPE: Release
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-20.04, ubuntu-22.04]
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt install build-essential cmake git libboost-system-dev libboost-thread-dev
|
||||
git clone https://github.com/google/googletest.git
|
||||
cd googletest
|
||||
cmake CMakeLists.txt
|
||||
make
|
||||
sudo make install
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- 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}}
|
29
.github/workflows/package.yaml
vendored
Normal file
29
.github/workflows/package.yaml
vendored
Normal file
|
@ -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
.github/workflows/test.yaml
vendored
Normal file
30
.github/workflows/test.yaml
vendored
Normal file
|
@ -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}}
|
|
@ -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/*
|
||||
|
@ -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
ci/entrypoint.sh
Executable file
10
ci/entrypoint.sh
Executable file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue