Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 0 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ jobs:
working-directory: integration_tests
run: yarn install

- name: Install Crossbuild dependencies
run: |
sudo apt-get update --allow-releaseinfo-change --fix-missing
sudo apt install -y qemu-user-static binfmt-support

- name: Run tests
env:
BUILD_LAYERS: true
Expand Down
47 changes: 24 additions & 23 deletions .github/workflows/check-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,36 @@ name: check-size
on: pull_request

jobs:
check-size:
runs-on: ubuntu-latest
build:
name: ruby ${{ matrix.ruby }} ${{ matrix.arch }}
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
strategy:
fail-fast: false
matrix:
ruby: ["3.2", "3.3", "3.4", "4.0"]
arch: ["amd64", "arm64"]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node 14.15
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 14.15

- name: Cache Node modules
id: cache-node-modules
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install

- name: Install Crossbuild dependencies
run: |
sudo apt-get update --allow-releaseinfo-change --fix-missing
sudo apt install -y qemu-user-static binfmt-support

- name: Build Layers
env:
RUBY_VERSION: ${{ matrix.ruby }}
ARCH: ${{ matrix.arch }}
run: ./scripts/build_layers.sh

- name: Check Size
env:
RUBY_VERSION: ${{ matrix.ruby }}
ARCH: ${{ matrix.arch }}
run: ./scripts/check_layer_size.sh

# Keeps the required status check name stable. Matrix jobs are reported
# individually, so branch protection that requires "check-size" still matches.
check-size:
needs: build
runs-on: ubuntu-24.04
if: always()
steps:
- name: Require all layer builds
run: test "${{ needs.build.result }}" = "success"
23 changes: 18 additions & 5 deletions scripts/build_layers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set -e
LAYER_DIR=".layers"
LAYER_FILES_PREFIX="datadog-lambda_ruby"
RUBY_VERSIONS=("3.2" "3.3" "3.4" "4.0")
ARCHITECTURES=("arm64" "amd64")

if [ -z "$RUBY_VERSION" ]; then
echo "Ruby version not specified, running for all ruby versions."
Expand All @@ -24,6 +25,18 @@ else
fi
fi

if [ -z "$ARCH" ]; then
echo "Architecture not specified, running for all architectures."
else
echo "Architecture is specified: $ARCH"
if (printf '%s\n' "${ARCHITECTURES[@]}" | grep -xq $ARCH); then
ARCHITECTURES=($ARCH)
else
echo "Unsupported architecture found, valid options are : ${ARCHITECTURES[@]}"
exit 1
fi
fi

function make_path_absolute {
echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
}
Expand Down Expand Up @@ -61,11 +74,11 @@ mkdir $LAYER_DIR

for ruby_version in "${RUBY_VERSIONS[@]}"
do
echo "Building layer for Ruby ${ruby_version} arch=arm64"
docker_build_zip ${ruby_version} $LAYER_DIR/${LAYER_FILES_PREFIX}-arm64-${ruby_version}.zip arm64 $GIT_REF

echo "Building layer for Ruby ${ruby_version} arch=amd64"
docker_build_zip ${ruby_version} $LAYER_DIR/${LAYER_FILES_PREFIX}-amd64-${ruby_version}.zip amd64 $GIT_REF
for arch in "${ARCHITECTURES[@]}"
do
echo "Building layer for Ruby ${ruby_version} arch=${arch}"
docker_build_zip ${ruby_version} $LAYER_DIR/${LAYER_FILES_PREFIX}-${arch}-${ruby_version}.zip ${arch} $GIT_REF
done
done


Expand Down
Loading