Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #473 from mcottontensor/signalling_tester
Browse files Browse the repository at this point in the history
Common library and Signalling Tester
  • Loading branch information
mcottontensor authored Jan 28, 2024
2 parents a27edcb + 2dc27d4 commit 6d87536
Show file tree
Hide file tree
Showing 94 changed files with 15,827 additions and 742 deletions.
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Relevant components:
- [ ] Signalling server
- [ ] Common library
- [ ] Frontend library
- [ ] Frontend UI library
- [ ] Matchmaker
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/create-gh-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,22 @@ jobs:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- name: Install common library deps
working-directory: ./Common
run: npm ci

- name: Build common library
working-directory: ./Common
run: npm run build

- name: Install library deps
working-directory: ./Frontend/library
run: npm ci

- name: NPM link common lib into library
working-directory: ./Frontend/library
run: npm link ../../Common

- name: Build frontend lib
working-directory: ./Frontend/library
run: npm run build
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/publish-common-library-to-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish common lib
on:
push:
workflow_dispatch:
branches: ['UE5.5']
paths: ['Common/package.json']
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: Common
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.17.0'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
14 changes: 13 additions & 1 deletion .github/workflows/run-library-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,25 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: '18.17.0'
registry-url: 'https://registry.npmjs.org'

- name: Install common library deps
working-directory: ./Common
run: npm ci

- name: Build common library
working-directory: ./Common
run: npm run build

- name: Install library deps
working-directory: ./Frontend/library
run: npm ci

- name: Link common library
working-directory: ./Frontend/library
run: npm link ../../Common

- name: Run frontend lib tests
working-directory: ./Frontend/library
run: npm run test
31 changes: 31 additions & 0 deletions .github/workflows/run-signalling-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run signalling tests

on:
workflow_dispatch:
push:
branches: ['UE5.5']
paths: ['Common/**', 'SignallingWebServer/**', 'SS_Test/**']
pull_request:
branches: ['UE5.5']
paths: ['Common/**', 'SignallingWebServer/**', 'SS_Test/**']

jobs:

build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./

permissions:
contents: write

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

- name: "Docker compose"
uses: isbang/compose-action@v1.5.1
with:
compose-file: "SS_Test/docker-compose.yml"
up-flags: "--build --abort-on-container-exit --exit-code-from tester"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ node.zip
SignallingWebServer/Public/
SignallingWebServer/certificates
.vscode
coverage/
coverage/
common/types/*
7 changes: 7 additions & 0 deletions Common/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist
node_modules
types
package-lock.json
package.json
tsconfig.json
.eslintrc.js
8 changes: 8 additions & 0 deletions Common/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright Epic Games, Inc. All Rights Reserved.

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended']
};
4 changes: 4 additions & 0 deletions Common/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/
node_modules/
types/
.vscode
21 changes: 21 additions & 0 deletions Common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## lib-pixelstreamingcommon

The common library for the browser/client side of Pixel Streaming experiences. This library exposes common functionality for frontend applications of the pixel streaming ecosystem.

See [lib-pixelstreamingfrontend](/Frontend/library) for an example of how to implement this library.

Currently exposed.
### Logger
A small helper class for handling logging across the pixel streaming infrastructure.

### ITransport
An interface to a transport protocol that is in charge of sending and receiving signalling messages. Users can make use of supplied transport protocols or implement their own transport protocol via extending this interface. They can then pass the transport into the constructor of `SignallingProtocol` which is explained below.

### WebSocketTransport
An `ITransport` implementation that sends signalling messages over a websocket. This is currently the only transport in use by the official pixel streaming frontend.

### SignallingProtocol
This is the object where the user should send/receive messages. Currently there are specific functions for specific messages sent, but in the future this should change to be more generic. You can specify your own transport protocol by passing an implementation of `ITransport` to this class, allowing you to send and receive messages through any protocol you wish.

### Adding it to your project
`npm i @epicgames-ps/lib-pixelstreamingcommon-ue5.5`
Loading

0 comments on commit 6d87536

Please sign in to comment.