ModernUO/.github/workflows/build-test.yml
Kamron Batman 10a69bf754
feat: Adds a memory mirrored ring buffer for networking. (#1533)
## Breaking Changes

Incoming packet registration signature has changed to:
```cs
delegate* void OnReceiveCallback(NetState state, SpanReader reader, int packetLength);

IncomingPackets.Register(int packetID, int length, bool ingame, OnReceiveCallback onReceive);
```

For example, an incoming packet handler signature would now look like this:
```cs
public static void SomeIncomingPacket(NetState state, SpanReader reader, int packetLength)
{
    // Parse the data
}
```

## Summary

Updates the network Pipe class to use a mirrored memory technique. This technique involves mapping the same physical memory to two contiguous virtual memory spaces so the byte buffer appears duplicated. This allows writing to a double-sized array to wrap around without the need for the `CircularBuffer` classes.

In practice this allows us to use `Span<byte>` as if the buffer was a regular array.


### Bug Fixes

- [X] Fixes bad fixed length string parsing
2023-10-09 00:57:53 -07:00

87 lines
2.5 KiB
YAML

name: Build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-macos:
runs-on: ${{ matrix.os }}
name: Build (${{ matrix.name }})
strategy:
fail-fast: false
matrix:
include:
- os: macos-12
name: MacOS 12
- os: macos-13
name: MacOS 13
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Setup .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.401
- name: Build
run: ./publish.cmd Release
- name: Migration Changes
run: git diff --exit-code ./**/Migrations/*.v*.json
- name: Test
run: dotnet test --no-restore
build-linux:
runs-on: ubuntu-latest
container: ${{ matrix.container }}
name: Build (${{ matrix.name }})
strategy:
fail-fast: false
matrix:
include:
- container: ubuntu:jammy
name: Ubuntu 22
packageManager: apt
- container: debian:bookworm
name: Debian 12
packageManager: apt
- container: debian:bullseye
name: Debian 11
packageManager: apt
- container: fedora:38
name: Fedora 38
packageManager: dnf
- container: fedora:37
name: Fedora 37
packageManager: dnf
- container: quay.io/centos/centos:stream8
name: CentOS 8 Stream
packageManager: dnf
- container: quay.io/centos/centos:stream9
name: CentOS 9 Stream
packageManager: dnf
steps:
- name: Enable EPEL
run: dnf upgrade --refresh -y && dnf install -y epel-release epel-next-release
if: ${{ startsWith(matrix.name, 'CentOS') }}
- name: Install Prerequisites using dnf
run: dnf makecache --refresh && dnf install -y findutils libicu zlib-devel zstd libargon2-devel tzdata
if: ${{ matrix.packageManager == 'dnf' }}
- name: Install Prerequisites using apt
run: apt-get update -y && apt-get install -y curl libicu-dev libz-dev zstd libargon2-dev tzdata
if: ${{ matrix.packageManager == 'apt' }}
- uses: actions/checkout@v3
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Setup .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.401
- name: Build
run: ./publish.sh Release
- name: Test
run: dotnet test --no-restore