ci: switch to forgejo actions
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
This commit is contained in:
parent
f07973e426
commit
6c8a7b3acc
6 changed files with 98 additions and 100 deletions
64
.forgejo/workflows/package.yaml
Normal file
64
.forgejo/workflows/package.yaml
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
---
|
||||||
|
name: Package
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
package:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
- dpkg: arm64
|
||||||
|
runs-on: debian-12-arm64
|
||||||
|
|
||||||
|
runs-on: debian-12-arm64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
apt update
|
||||||
|
apt install -y \
|
||||||
|
build-essential cmake git libboost-system-dev libboost-thread-dev file libgtest-dev googletest
|
||||||
|
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: configure
|
||||||
|
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCPACK_DEBIAN_PACKAGE_RELEASE=compair1
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
run: cmake --build build --config Release -j2
|
||||||
|
|
||||||
|
- name: test
|
||||||
|
working-directory: build
|
||||||
|
run: ctest -C Release
|
||||||
|
|
||||||
|
- name: build deb
|
||||||
|
working-directory: build
|
||||||
|
run: cpack --build . -G DEB
|
||||||
|
|
||||||
|
- name: get tag
|
||||||
|
run: |
|
||||||
|
echo "TAG=$(git describe --abbrev=0 --tags)-compair1" >>$GITHUB_ENV
|
||||||
|
|
||||||
|
# https://forgejo.org/docs/latest/user/packages/debian/#publish-a-package
|
||||||
|
- name: push deb to apt repository
|
||||||
|
env:
|
||||||
|
REPO: ${{ github.repository }}
|
||||||
|
run: |
|
||||||
|
url="${GITHUB_SERVER_URL}/api/packages/${{ github.repository_owner }}/debian/pool/bookworm/compair/upload"
|
||||||
|
echo "api url: $url"
|
||||||
|
debfile="_packages/libcreate_${TAG}_${{ matrix.platform.dpkg }}.deb"
|
||||||
|
echo "uploading file: $debfile"
|
||||||
|
curl --fail-with-body \
|
||||||
|
-X PUT \
|
||||||
|
--user "oauth2:${{ secrets.PACKAGE_REGISTRY_TOKEN }}" \
|
||||||
|
--upload-file "$debfile" \
|
||||||
|
"$url"
|
||||||
|
echo "final url: ${GITHUB_SERVER_URL}/${{ github.repository_owner }}/-/packages/debian/libcreate/${TAG}"
|
34
.forgejo/workflows/test.yaml
Normal file
34
.forgejo/workflows/test.yaml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
---
|
||||||
|
name: Build and test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
BUILD_TYPE: Release
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: debian-12
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
apt update
|
||||||
|
apt install -y \
|
||||||
|
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 }}
|
||||||
|
|
||||||
|
- 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 }}
|
41
.github/workflows/package.yaml
vendored
41
.github/workflows/package.yaml
vendored
|
@ -1,41 +0,0 @@
|
||||||
name: Package
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "*"
|
|
||||||
|
|
||||||
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
|
|
||||||
- name: Push deb to compREP
|
|
||||||
uses: cpina/github-action-push-to-another-repository@main
|
|
||||||
env:
|
|
||||||
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
|
|
||||||
with:
|
|
||||||
source-directory: "output/"
|
|
||||||
target-directory: "debs/libcreate/"
|
|
||||||
destination-github-username: "F-WuTS"
|
|
||||||
destination-repository-name: "compREP"
|
|
||||||
target-branch: master
|
|
30
.github/workflows/test.yaml
vendored
30
.github/workflows/test.yaml
vendored
|
@ -1,30 +0,0 @@
|
||||||
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}}
|
|
||||||
|
|
||||||
- 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}}
|
|
|
@ -1,14 +0,0 @@
|
||||||
FROM debian:bookworm
|
|
||||||
|
|
||||||
RUN apt update && \
|
|
||||||
apt install -y \
|
|
||||||
build-essential cmake git file tree \
|
|
||||||
libboost-system-dev libboost-thread-dev \
|
|
||||||
libgtest-dev googletest && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
WORKDIR /libcreate
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
WORKDIR /libcreate/build
|
|
||||||
ENTRYPOINT ["/bin/bash", "/libcreate/ci/entrypoint.sh"]
|
|
|
@ -1,15 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
cmake -B /libcreate/build -S /libcreate -DCMAKE_BUILD_TYPE=Release
|
|
||||||
cmake --build /libcreate/build --config Release
|
|
||||||
ctest -C Release --output-on-failure
|
|
||||||
cpack --build /libcreate/build -G DEB
|
|
||||||
|
|
||||||
debs=(/libcreate/_packages/*.deb)
|
|
||||||
cp "${debs[0]}" /tmp/libcreate.deb
|
|
||||||
dpkg-deb -R /tmp/libcreate.deb /tmp/libcreate
|
|
||||||
tree /tmp/libcreate
|
|
Loading…
Add table
Add a link
Reference in a new issue