Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
paths-ignore:
- "**.md"
- "**ue-docker.yml"

jobs:
android-sdk:
Expand All @@ -29,16 +28,13 @@ jobs:
uses: ./.github/workflows/sdk-build.yml
with:
target: Linux
# Build for an older GLIBC so that it can run with the old GLIBC included in EpicGames' Unreal docker images.
# See discussion in https://github.com/getsentry/sentry-unreal/pull/173
runsOn: ubuntu-20.04
runsOn: ubuntu-22.04

linux-arm64-sdk:
uses: ./.github/workflows/sdk-build.yml
with:
target: LinuxArm64
runsOn: ubuntu-22.04-arm
container: arm64v8/ubuntu:20.04

windows-crashpad-sdk:
uses: ./.github/workflows/sdk-build.yml
Expand Down Expand Up @@ -152,7 +148,8 @@ jobs:
fail-fast: false
matrix:
# Note: these versions must match scripts/packaging/engine-versions.txt
unreal: ['4.27', '5.0', '5.1', '5.2', '5.3', '5.4', '5.5']
# Note: Currently 5.0 is not supported due to ue4-docker issue https://github.com/adamrehn/ue4-docker/issues/373
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's old enough we could prob remove support btw. Looking at numbers seems to be safe.

Or just call it 'best effort'

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While supporting older engine versions (UE4 and "early" UE5) doesn't require significant effort on our side it makes sense to continue running CI checks for these when possible.

There are still quite a few orgs using 4.27 and since Epic made a lot of API changes between 5.0 and 5.2 we'll need to handle some version-specific code anyway.

unreal: ['4.27', '5.1', '5.2', '5.3', '5.4', '5.5']
uses: ./.github/workflows/test-linux.yml
with:
unreal-version: ${{ matrix.unreal }}
Expand Down
14 changes: 1 addition & 13 deletions .github/workflows/sdk-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ jobs:
run:
shell: bash
steps:
- name: Configure env for Linux arm64 runner
if: ${{ inputs.target == 'LinuxArm64' }}
run: |
apt-get update
apt-get -y install sudo
apt-get -y install wget
apt-get -y install cmake
apt-get -y install software-properties-common
apt-get -y install git
git config --global --add safe.directory $(pwd)

- uses: actions/checkout@v4

- name: Select submodule
Expand All @@ -55,8 +44,7 @@ jobs:
with:
path: |
${{ steps.env.outputs.path }}
modules/sentry-java/sentry-android-ndk/build/intermediates/merged_native_libs/release/out/lib
key: sdk=${{ inputs.target }}-${{ hashFiles('submodule-status', 'scripts/build-*.sh', '.github/workflows/sdk.yml') }}
key: sdk=${{ inputs.target }}-${{ hashFiles('submodule-status', 'scripts/build-*.sh', '.github/workflows/sdk-build.yml') }}

- name: Install Linux/LinuxArm64 Dependencies
if: ${{ (inputs.target == 'Linux' || inputs.target == 'LinuxArm64') && steps.cache.outputs.cache-hit != 'true' }}
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
required: true
type: string

env:
REGISTRY: ghcr.io

jobs:
test:
name: Test
Expand Down Expand Up @@ -34,9 +37,15 @@ jobs:
# time du --max-depth=3 --threshold=100M -h /usr /opt /var 2>/dev/null | sort -hr
df -h

- name: Log in to GitHub package registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Start Docker container
run: |
echo ${{ secrets.DOCKER_TOKEN }} | docker login ghcr.io -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
# We start the container with the user ID of the parent GH action user to avoid permission issues on volume.
# For UE 5.4 we have to enable ipv6 to fix container startup issues. See https://github.com/adamrehn/ue4-docker/issues/357
uid=$(id -u) # the GH action user ID
Expand All @@ -52,7 +61,7 @@ jobs:
--env HOME="/home/$user" \
--env PATH="/home/$user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
--network ip6net -p 80:80 \
ghcr.io/epicgames/unreal-engine:dev-slim-${{ inputs.unreal-version }}.1
ghcr.io/getsentry/unreal-docker:${{ inputs.unreal-version }}-linux
docker logout ghcr.io
# Add the user so it has a home directory (needed to run tests later on)
docker exec --user root unreal useradd -u $uid -g $gid --create-home $user
Expand All @@ -74,12 +83,6 @@ jobs:
mkdir -p /home/ue4/UnrealEngine/Engine/Source/Epic/UnrealEngine && chown -R $uid /home/ue4/UnrealEngine/Engine/Source/Epic ;
mkdir -p /home/ue4/UnrealEngine/Engine/Intermediate/Build/BuildCookRun && chown -R $uid /home/ue4/UnrealEngine/Engine/Intermediate/Build/BuildCookRun "

- name: Setup C++ runtime
run: docker exec --user root unreal bash -c '
apt-get update ;
add-apt-repository ppa:ubuntu-toolchain-r/test ;
apt-get install -y libstdc++6'

- name: Download package
uses: actions/download-artifact@v4
with:
Expand Down
106 changes: 106 additions & 0 deletions .github/workflows/ue-docker-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Build UE Linux Docker image

on:
workflow_dispatch:
inputs:
ue_version:
description: Select Unreal Engine version
required: true
type: choice
options:
- 4.27
- 5.1
- 5.2
- 5.3
- 5.4
- 5.5
ue_repo:
description: Set Unreal Engine repository
required: true
type: string
default: 'https://github.com/getsentry/UnrealEngine.git'
clean_disk:
description: Clean up disk space before Docker build
required: true
type: boolean
default: false

env:
REGISTRY: ghcr.io

jobs:
build:
name: 'Build for UE ${{ inputs.ue_version }}'
runs-on: ubuntu-latest-32-cores

permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4

# Building docker images for newer UE versions may require extra disk space
- name: Clean up disk space before Docker build
if: ${{ inputs.clean_disk == true }}
run: |
# time df -h
sudo time swapoff -a
sudo time rm -f /swapfile
sudo time rm -rf /usr/local/lib/android
sudo time rm -rf /usr/share/dotnet
sudo time rm -rf /usr/share/swift
sudo time rm -rf /usr/local/share/powershell
sudo time rm -rf /usr/local/.ghcup
sudo time rm -rf /usr/local/lib/node_modules
sudo time rm -rf /usr/local/share/boost
sudo time rm -rf /usr/lib/google-cloud-sdk
sudo time rm -rf /usr/lib/jvm
sudo time rm -rf /opt/pipx
sudo time rm -rf /opt/ghc
sudo time rm -rf "$AGENT_TOOLSDIRECTORY"
sudo time apt-get clean
sudo time rm -rf /var/lib/apt/lists/*
# time docker rmi $(docker image ls -aq)
# time du --max-depth=3 --threshold=100M -h /usr /opt /var 2>/dev/null | sort -hr
df -h

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12.8'
architecture: 'x64'

- name: Install unreal-docker
run: |
pip install ue4-docker

- name: Configure unreal-docker
run: |
ue4-docker setup

- name: Build Unreal Engine Docker image
run: |
ue4-docker build custom -repo="${{ inputs.ue_repo }}" -branch="${{ inputs.ue_version }}" \
-basetag ubuntu22.04 \
-suffix "${{ inputs.ue_version }}" \
-username=${{ secrets.DOCKER_USERNAME }} \
-password=${{ secrets.DOCKER_TOKEN }} \
--linux \
--target minimal \
--exclude debug \
--exclude templates \
--exclude ddc

- name: Log in to GitHub package registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Tag and push Docker image with pre-built Unreal Engine
run: |
docker tag adamrehn/ue4-minimal:custom-${{ inputs.ue_version }} ${{ env.REGISTRY }}/getsentry/unreal-docker:${{ inputs.ue_version }}-linux
docker push ${{ env.REGISTRY }}/getsentry/unreal-docker:${{ inputs.ue_version }}-linux