generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 22
Add ci unique id #913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
rawalexe
wants to merge
4
commits into
main
Choose a base branch
from
ciTest
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add ci unique id #913
Changes from 3 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 warningCode 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}
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium