Skip to content

Conversation

rawalexe
Copy link
Member

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@rawalexe rawalexe force-pushed the ciTest branch 6 times, most recently from 2f82a75 to 28797fb Compare August 1, 2025 11:34
@rawalexe rawalexe marked this pull request as draft August 13, 2025 23:39
Comment on lines +13 to +59
runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
build_type: [RelWithDebInfo, MinSizeRel]
steps:
- uses: actions/checkout@v4

- name: Set up Podman
run: |
sudo apt-get update
sudo apt-get install -y podman

- name: Build in Debian Bookworm container
run: |
podman run --rm \
-v $PWD:/workspace:Z \
-w /workspace \
arm64v8/debian:bookworm-slim \
bash -c "
apt-get update && apt-get -y upgrade && \
apt-get -y install --no-install-recommends \
build-essential pkg-config cmake git ca-certificates file \
libssl-dev libcurl4-openssl-dev libsqlite3-dev \
libyaml-dev libsystemd-dev liburiparser-dev \
uuid-dev libevent-dev libzip-dev && \
update-ca-certificates && \
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DGGL_SYSTEMD_SYSTEM_USER=ggcore \
-DGGL_SYSTEMD_SYSTEM_GROUP=ggcore \
-DCMAKE_INSTALL_PREFIX=/usr && \
make -C build -j\$(nproc) && \
cd build && cpack -G DEB
"

- name: Save packages
run: |
mkdir -p packages/
cp build/*.deb packages/

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: debian-bookworm-${{ matrix.build_type }}
path: packages/*.deb
retention-days: 7

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +13 to +117
runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
build_type: [RelWithDebInfo, MinSizeRel]
steps:
- uses: actions/checkout@v4

- name: Set up Podman
run: |
sudo apt-get update
sudo apt-get install -y podman

- name: Cache Podman image
uses: actions/cache@v4
with:
path: |
~/podman-raspios-image.tar
key:
${{ runner.os }}-podman-raspios-${{
hashFiles('misc/buildtestcontainer/*') }}

- name: Create Pi-compatible Containerfile
run: |
cat > Containerfile.pi << 'EOF'
FROM arm64v8/debian:bookworm
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get -y install --no-install-recommends \
systemd systemd-sysv dbus ca-certificates sudo nano bash-completion \
build-essential pkg-config cmake git curl file gdb python3 \
libssl-dev libcurl4-openssl-dev libsqlite3-dev sqlite3 libyaml-dev \
libsystemd-dev liburiparser-dev uuid-dev libevent-dev cgroup-tools libzip-dev \
&& apt-get clean

COPY ./getty-override.conf \
/etc/systemd/system/console-getty.service.d/override.conf

RUN echo "export MAKEFLAGS=-j" >> /root/.profile

CMD ["/lib/systemd/systemd"]
EOF

- name: Build and save container for Raspberry Pi OS
run: |
if [ ! -f ~/podman-raspios-image.tar ]; then
podman build -f Containerfile.pi --arch=arm64 misc/buildtestcontainer -t raspios-container
podman save raspios-container:latest > ~/podman-raspios-image.tar
else
podman load < ~/podman-raspios-image.tar
fi

- name: Run build in container
shell: bash
run: |
podman run -v $PWD/.:/aws-greengrass-lite --replace --name ggl raspios-container:latest bash -c "\
cd /aws-greengrass-lite && \
rm -rf build/ && \
cmake -B build \
-DGGL_LOG_LEVEL=DEBUG \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_FIND_DEBUG_MODE=ON \
-DGGL_SYSTEMD_SYSTEM_USER=ggcore \
-DGGL_SYSTEMD_SYSTEM_GROUP=ggcore \
-DGGL_SYSTEMD_SYSTEM_DIR=/lib/systemd/system \
-DCMAKE_INSTALL_PREFIX=/usr && \
make -C build -j$(nproc) && \
cd build && cpack -v -G DEB && cd - \
"

- name: Save package
run: |
mkdir ${{ github.workspace }}/zipfile/
cp ${{ github.workspace }}/build/*.deb ${{ github.workspace }}/zipfile/

- name: Generate readme / install file
run: |
cat ${{ github.workspace }}/.github/workflows/packaging/readme.template.txt >> ${{ github.workspace }}/zipfile/readme.txt
cp ${{ github.workspace }}/.github/workflows/packaging/install-greengrass-lite.sh ${{ github.workspace }}/zipfile/
sed -i 's|{{ VERSION_LINK }}|${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|g' ${{ github.workspace }}/zipfile/readme.txt
sed -i 's|{{ UBUNTU_VERSION }}|raspios|g' ${{ github.workspace }}/zipfile/install-greengrass-lite.sh
cat ${{ github.workspace }}/LICENSE >> ${{ github.workspace }}/zipfile/readme.txt

- name: md5sums
run: |
md5sum ${{ github.workspace }}/zipfile/*

- name: Save package
uses: actions/upload-artifact@v4
with:
name: aws-greengrass-lite-raspios-${{ matrix.build_type }}
path: |
${{ github.workspace }}/zipfile/*
retention-days: 1

- name:
Save arm64 package without build type - default package to download
if: matrix.build_type == 'MinSizeRel'
uses: actions/upload-artifact@v4
with:
name: aws-greengrass-lite-raspios-arm64
path: |
${{ github.workspace }}/zipfile/*
retention-days: 1

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants