Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kirre-bylund committed Nov 1, 2024
1 parent 79c0c38 commit 0028694
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 57 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/build-with-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build plugin using unreal conainer
run-name: selfhosted-poc
on:
push:
branches: # Made towards the following
- main
- ci/*
tags:
- v**
schedule:
- cron: '5 6 * * 0-4'
workflow_dispatch: {}

jobs:
build-sdk:
strategy:
fail-fast: false
matrix:
UE_IMAGE: ${{ fromJson(VARS.CI_UNREAL_IMAGES) }}

name: Build SDK with Unreal container and UAT
runs-on: ubuntu-22.04-4-core
steps:
- name: Setup git
run: |
git config --global --add safe.directory /__w/unreal-sdk/unreal-sdk
- name: Checkout dev for nightly build
if: ${{ github.event_name == 'schedule' }}
uses: actions/checkout@v4
with:
ref: dev

- name: Checkout current branch for build
if: ${{ github.event_name != 'schedule' }}
uses: actions/checkout@v4

- name: Pull unreal image ${{ matrix.UE_IMAGE }}
run: |
docker login ghcr.io -u ${{ SECRETS.UNREAL_DOCKER_PACKAGES_READ_USERNAME }} -p ${{ SECRETS.UNREAL_DOCKER_PACKAGES_READ_ACCESS_TOKEN }}
docker pull ghcr.io/epicgames/unreal-engine:${{ matrix.UE_IMAGE }}
- name: Make build & log locations
run: |
mkdir -p ../../tmp/build
mkdir -p ../../tmp/logs
- name: Set plugin information variables
run: |
SDK_PATH="$(pwd)"
echo "SDK_PATH=${SDK_PATH}" >> $GITHUB_ENV
SDK_NAME=`find "$SDK_PATH" -type f -name "*.uplugin" | sed -n -r "s/.*\/([-A-Za-z0-9_]+)\.uplugin/\1/p"`
echo "SDK_NAME=${SDK_NAME}" >> $GITHUB_ENV
SDK_VERSION=`sed -n -r 's/^ +\"VersionName\": \"([0-9]+.[0-9]+.[0-9]+)\",/\1/p' < "$SDK_PATH/$SDK_NAME/$SDK_NAME.uplugin"`
echo "SDK_VERSION=${SDK_VERSION}" >> $GITHUB_ENV
sed -i -r "s/^( +)(\"VersionName\": \"[0-9\.]+\",)/\1\2\n\1\"EngineVersion\": \"${{ matrix.UE_VERSION }}\",/g" "$SDK_PATH/$SDK_NAME/$SDK_NAME.uplugin"
- name: Build Plugin with Unreal Automation Tool in image ${{ matrix.UE_IMAGE }}
run: |
docker run --rm -v "$(pwd):/mnt/source" -v "$(pwd)/../../tmp/build:/mnt/build" -v "$(pwd)/../../tmp/build:/mnt/logs" ghcr.io/epicgames/unreal-engine:${{ matrix.UE_IMAGE }} sh -c "/home/ue4/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh BuildPlugin -TargetPlatforms="Linux" -Plugin="/mnt/source/${SDK_NAME}/${SDK_NAME}.uplugin" -Package="/mnt/build" -Rocket -enablecodeanalysis" 2>&1 | tee ../../tmp/logs/UAT.log
- name: Expose log as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.UE_IMAGE }}-UAT.log
path: ${{ ENV.SDK_PATH }}../../tmp/logs/UAT.log

- name: Check build result
run: |
grep -i -q -E -- '(Exited with code: [1-9]+?)|(ExitCode=[1-9]+?)' ../../tmp/logs/UAT.log
BUILD_RESULT=$?
if [ 0 -eq $BUILD_RESULT ]; then
echo " ❌ Build failed for ${{ matrix.UE_IMAGE }}, see ${{ matrix.UE_IMAGE }}-UAT.log for more information"
exit 666
fi
60 changes: 3 additions & 57 deletions .github/workflows/selfhosted-poc.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,12 @@
name: Selfhosted Runner Proof of Concept
name: Selfhosted POC
run-name: selfhosted-poc
on:
push:
branches: # Made towards the following
- ci/*
branches: # Made towards the following
- ci/*
workflow_dispatch: {}

jobs:
build-sdk:
strategy:
fail-fast: false
matrix:
UE_IMAGE: ${{ fromJson(VARS.CI_UNREAL_IMAGES) }}
name: Build SDK with Unreal container and UAT
runs-on: ubuntu-22.04-4-core
steps:
- name: Setup git
run: |
git config --global --add safe.directory /__w/unreal-sdk/unreal-sdk
- name: Checkout this repository
uses: actions/checkout@v4

- name: Pull unreal image ${{ matrix.UE_IMAGE }}
run: |
docker login ghcr.io -u ${{ SECRETS.UNREAL_DOCKER_PACKAGES_READ_USERNAME }} -p ${{ SECRETS.UNREAL_DOCKER_PACKAGES_READ_ACCESS_TOKEN }}
docker pull ghcr.io/epicgames/unreal-engine:${{ matrix.UE_IMAGE }}
- name: Make build & log locations
run: |
mkdir -p ../../tmp/build
mkdir -p ../../tmp/logs
- name: Set plugin information variables
run: |
SDK_PATH="$(pwd)"
echo "SDK_PATH=${SDK_PATH}" >> $GITHUB_ENV
SDK_NAME=`find "$SDK_PATH" -type f -name "*.uplugin" | sed -n -r "s/.*\/([-A-Za-z0-9_]+)\.uplugin/\1/p"`
echo "SDK_NAME=${SDK_NAME}" >> $GITHUB_ENV
SDK_VERSION=`sed -n -r 's/^ +\"VersionName\": \"([0-9]+.[0-9]+.[0-9]+)\",/\1/p' < "$SDK_PATH/$SDK_NAME/$SDK_NAME.uplugin"`
echo "SDK_VERSION=${SDK_VERSION}" >> $GITHUB_ENV
sed -i -r "s/^( +)(\"VersionName\": \"[0-9\.]+\",)/\1\2\n\1\"EngineVersion\": \"${{ matrix.UE_VERSION }}\",/g" "$SDK_PATH/$SDK_NAME/$SDK_NAME.uplugin"
- name: Build Plugin with Unreal Automation Tool in image ${{ matrix.UE_IMAGE }}
run: |
docker run --rm -v "$(pwd):/mnt/source" -v "$(pwd)/../../tmp/build:/mnt/build" -v "$(pwd)/../../tmp/build:/mnt/logs" ghcr.io/epicgames/unreal-engine:${{ matrix.UE_IMAGE }} sh -c "/home/ue4/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh BuildPlugin -TargetPlatforms="Linux" -Plugin="/mnt/source/${SDK_NAME}/${SDK_NAME}.uplugin" -Package="/mnt/build" -Rocket -enablecodeanalysis" > ../../tmp/logs/UAT.log
- name: Check build result
run: |
grep -i -q -E -- '(Exited with code: [1-9]+?)|(ExitCode=[1-9]+?)' ../../tmp/logs/UAT.log
BUILD_RESULT=$?
if [ 0 -eq $BUILD_RESULT ]; then
echo " ❌ Build failed for ${{ matrix.UE_IMAGE }}, see ${{ matrix.UE_IMAGE }}-UAT.log for more information"
exit 666
fi
- name: Expose logs as artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.UE_IMAGE }}-UAT.log
path: ${{ ENV.SDK_PATH }}../../tmp/logs/UAT.log

ping-stage-test:
name: Ping stage backend
if: false
Expand Down

0 comments on commit 0028694

Please sign in to comment.