Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/debian-bookworm-packaging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Debian Bookworm - Build deb packages
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
build:
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
Comment on lines +13 to +59

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}
117 changes: 117 additions & 0 deletions .github/workflows/raspbian-packaging-aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Raspberry Pi OS aarch64 - Build deb packages and zip files
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
build:
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
Comment on lines +13 to +117

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}
15 changes: 15 additions & 0 deletions .github/workflows/uat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
unset-current-credentials: true

- name: Run UAT tests
env:
CI_UNIQUE_ID: ${{ github.run_id }}-${{ strategy.job-index }}
run: |
cd aws-greengrass-testing
./run-tests.sh \
Expand All @@ -58,3 +60,16 @@ jobs:
--commit-id=${{ github.event.pull_request.head.sha }} \
--aws-region=us-west-2 \
--test-category=${{ matrix.test-category.category }}

- name: Upload system logs
if: always()
uses: actions/upload-artifact@v4
with:
name:
system-logs-${{ matrix.test-category.category }}-${{ github.run_id
}}
path: |
/var/log/syslog
/var/log/kern.log
/var/log/dmesg
if-no-files-found: warn