Skip to content

Commit

Permalink
Removed NodeJS event emitter in common library. (#330)
Browse files Browse the repository at this point in the history
* Removed NodeJS event emitter in common and rolled our own.
* Disable Chrome locked mouse tests and add npm run build to the repo root.
* Add missing package.json from root into SS dockerfile
* Decouple healthcheck of public libs from healthcheck of local libs
* Disable Linux stream test
* Added #bypass-publish-check to our Github actions

---------

Co-authored-by: Matthew Cotton <[email protected]>
  • Loading branch information
lukehb and mcottontensor authored Nov 28, 2024
1 parent ddd2ab3 commit afbeb07
Show file tree
Hide file tree
Showing 34 changed files with 491 additions and 169 deletions.
98 changes: 1 addition & 97 deletions .github/workflows/healthcheck-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,100 +57,4 @@ jobs:

- name: Clean build of frontend implementation
working-directory: Frontend/implementations/typescript
run: npm install && npm run build

build-signalling-only:
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
sparse-checkout: 'Signalling'
sparse-checkout-cone-mode: false

- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'

- name: Build signalling using published packages only
working-directory: Signalling
run: npm install && npm run build && npm run lint

build-wilbur-only:
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
sparse-checkout: 'SignallingWebServer'
sparse-checkout-cone-mode: false

- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'

- name: Build Wilbur using published packages only
working-directory: SignallingWebServer
run: npm install && npm run build && npm run lint

build-frontend-only:
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
sparse-checkout: 'Frontend/library'
sparse-checkout-cone-mode: false

- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'

- name: Build Frontend/library using published packages only
working-directory: Frontend/library
run: npm install && npm run build && npm run lint && npm run test

build-frontend-ui-only:
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
sparse-checkout: 'Frontend/ui-library'
sparse-checkout-cone-mode: false

- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'

- name: Build Frontend/ui-library using published packages only
working-directory: Frontend/ui-library
run: npm install && npm run build && npm run lint

build-implementation-typescript-only:
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
sparse-checkout: 'Frontend/implementations/typescript'
sparse-checkout-cone-mode: false

- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'

- name: Build Frontend/implementations/typescript using published packages only
working-directory: Frontend/implementations/typescript
run: npm install && npm run build

run: npm install && npm run build
105 changes: 105 additions & 0 deletions .github/workflows/healthcheck-libs-with-public-deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Check health of libraries (public deps)

on:
workflow_dispatch:
push:
paths:
- "Common/**"
- "Signalling/**"
- "SignallingWebServer/**"
- "Frontend/library/**"
- "Frontend/ui-library/**"
- "Frontend/implementations/typescript/**"
pull_request:
paths:
- "Common/**"
- "Signalling/**"
- "SignallingWebServer/**"
- "Frontend/library/**"
- "Frontend/ui-library/**"
- "Frontend/implementations/typescript/**"

env:
NODE_VERSION: 18.17.x

jobs:
check-if-bypass:
runs-on: ubuntu-latest
outputs:
bypass: ${{ steps.checkbypass.outputs.bypass }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
fetch-depth: 5 # This should be enough history to contain the commit that triggered the PR

- name: Check commit message for push event
if: github.event_name == 'push'
run: |
COMMIT=${{ github.event.head_commit.message }}
echo "Commit message: $COMMIT"
echo "COMMIT=$COMMIT" >> $GITHUB_ENV
- name: Check commit message for pull request event
if: github.event_name == 'pull_request'
run: |
# Get the latest commit SHA for the pull request
COMMIT_SHA="${{ github.event.pull_request.head.sha }}"
echo "Fetching commit message for PR commit: $COMMIT_SHA"
COMMIT_MESSAGE=$(git log -1 --pretty=%B "$COMMIT_SHA")
echo "Commit message: $COMMIT_MESSAGE"
echo "COMMIT=$COMMIT_MESSAGE" >> $GITHUB_ENV
- name: Check commit message for bypass
id: checkbypass
run: |
echo "$COMMIT"
if echo "$COMMIT" | grep -q "#bypass-publish-check"; then
echo "bypass=true" >> $GITHUB_OUTPUT
echo "bypass=true"
else
echo "bypass=false" >> $GITHUB_OUTPUT
echo "bypass=false"
fi
build-using-public-deps:
needs: check-if-bypass
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure' && needs.check-if-bypass.outputs.bypass == 'false' # Only run if bypass is false
runs-on: ubuntu-latest
steps:

- name: Checkout source code
uses: actions/checkout@v3

- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'

- name: Remove NPM workspaces
run: rm package.json && rm package-lock.json

- name: Build signalling using published packages only
if: always()
working-directory: Signalling
run: npm install && npm run build && npm run lint

- name: Build Wilbur using published packages only
if: always()
working-directory: SignallingWebServer
run: npm install && npm run build && npm run lint

- name: Build Frontend/library using published packages only
if: always()
working-directory: Frontend/library
run: npm install && npm run build && npm run lint && npm run test

- name: Build Frontend/ui-library using published packages only
if: always()
working-directory: Frontend/ui-library
run: npm install && npm run build && npm run lint

- name: Build Frontend/implementations/typescript using published packages only
if: always()
working-directory: Frontend/implementations/typescript
run: npm install && npm run build
47 changes: 24 additions & 23 deletions .github/workflows/healthcheck-streaming.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,32 @@ on:
- "Extras/**"

jobs:
streaming-test-linux:
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
# Uncomment when we can Linux test to capture a non-black screenshot using software renderer.
# streaming-test-linux:
# if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
# runs-on: ubuntu-latest
# steps:
# - name: Checkout source code
# uses: actions/checkout@v3

- name: Create results directory
run: mkdir Extras/MinimalStreamTester/results

- name: Launch stream test in docker containers
uses: isbang/[email protected]
with:
compose-file: "Extras/MinimalStreamTester/docker-compose.yml"
up-flags: "--build --abort-on-container-exit --exit-code-from tester"

- name: Get short sha
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
# - name: Create results directory
# run: mkdir Extras/MinimalStreamTester/results

# - name: Launch stream test in docker containers
# uses: isbang/[email protected]
# with:
# compose-file: "Extras/MinimalStreamTester/docker-compose.yml"
# up-flags: "--build --abort-on-container-exit --exit-code-from tester"

# - name: Get short sha
# id: vars
# run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Upload results
uses: actions/upload-artifact@v4
with:
name: Results-${{ steps.vars.outputs.sha_short }}-Linux
path: Extras/MinimalStreamTester/results
# - name: Upload results
# uses: actions/upload-artifact@v4
# with:
# name: Results-${{ steps.vars.outputs.sha_short }}-Linux
# path: Extras/MinimalStreamTester/results

streaming-test-win:
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
Expand Down
2 changes: 1 addition & 1 deletion Common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epicgames-ps/lib-pixelstreamingcommon-ue5.5",
"version": "0.1.1",
"version": "0.1.2",
"description": "Common utilities library for Unreal Engine 5.5 Pixel Streaming",
"main": "build/commonjs/pixelstreamingcommon.js",
"module": "build/esm/pixelstreamingcommon.js",
Expand Down
Loading

0 comments on commit afbeb07

Please sign in to comment.