Skip to content

HTTP$ end-to-end big strings: dynamic intake buffers (native + WASM) #127

HTTP$ end-to-end big strings: dynamic intake buffers (native + WASM)

HTTP$ end-to-end big strings: dynamic intake buffers (native + WASM) #127

Workflow file for this run

name: Build RGC-BASIC on all platforms
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact: basic-linux
archive: basic-linux.tar.gz
outdir: linux
bin: basic
build_gfx: true
- os: macos-latest
artifact: basic-macos
archive: basic-macos.tar.gz
outdir: mac
bin: basic
build_gfx: true
- os: windows-latest
artifact: basic-windows
archive: basic-windows.zip
outdir: windows
bin: basic.exe
build_gfx: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: false
# basic-gfx links a patched raylib built from third_party/raylib-native
# by scripts/build-raylib-native.sh. Install only raylib's build deps;
# no system libraylib needed (Makefile no longer reads pkg-config for
# this target).
- name: Install raylib build deps (Linux)
if: runner.os == 'Linux' && matrix.build_gfx
run: |
set -e
sudo apt-get update
sudo apt-get install -y build-essential git pkg-config \
libasound2-dev libx11-dev libxrandr-dev libxi-dev \
libxinerama-dev libxcursor-dev libgl1-mesa-dev libglu1-mesa-dev
- name: Build (Unix)
if: runner.os != 'Windows'
run: |
make
if [ "${{ matrix.build_gfx }}" = "true" ]; then
make basic-gfx
fi
- name: Run full test suite (Unix)
if: runner.os != 'Windows'
run: |
set -e
make check
# MSYS2 toolchain for basic-gfx on Windows. No mingw-w64-raylib package
# here — scripts/build-raylib-native.cmd clones + patches raylib 5.5
# into third_party/raylib-native and links it statically.
- name: Setup MSYS2 (Windows)
if: runner.os == 'Windows' && matrix.build_gfx
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-make
mingw-w64-x86_64-pkg-config
git
- name: Build (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
set -e
mingw32-make
if [ "${{ matrix.build_gfx }}" = "true" ]; then
mingw32-make basic-gfx
fi
- name: Build & run C unit tests (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
set -e
mingw32-make gfx_video_test
./gfx_video_test.exe
# GET tests skipped on Windows: basic.exe uses _kbhit/_getch (console only),
# not stdin; piped input never reaches the program, so tests would hang.
- name: Run .bas suite (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
set -e
sh tests/run_bas_suite.sh ./basic.exe
- name: Package artifact (Unix)
if: runner.os != 'Windows'
run: |
mkdir -p out/${{ matrix.outdir }}
cp ${{ matrix.bin }} out/${{ matrix.outdir }}/basic
if [ "${{ matrix.build_gfx }}" = "true" ] && [ -f basic-gfx ]; then
cp basic-gfx out/${{ matrix.outdir }}/basic-gfx
fi
cp -r examples out/${{ matrix.outdir }}/
cd out
tar czf ${{ matrix.archive }} ${{ matrix.outdir }}
- name: Package artifact (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
mkdir -p out/${{ matrix.outdir }}
cp ${{ matrix.bin }} out/${{ matrix.outdir }}/basic.exe
if [ "${{ matrix.build_gfx }}" = "true" ] && [ -f basic-gfx.exe ]; then
cp basic-gfx.exe out/${{ matrix.outdir }}/basic-gfx.exe
# basic-gfx.exe statically links libraylib.a — no raylib / glfw3
# DLLs to bundle. winpthread is statically linked via
# -Wl,-Bstatic -lwinpthread. The resulting binary runs outside
# MSYS2 without extra dependencies.
fi
cp -r examples out/${{ matrix.outdir }}/
cd out
powershell -Command "Compress-Archive -Path '${{ matrix.outdir }}' -DestinationPath '${{ matrix.archive }}'"
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: out/${{ matrix.archive }}
wasm:
name: Web / WASM build + browser test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: false
- name: Install Emscripten (emsdk)
run: |
sudo apt-get update
sudo apt-get install -y python3 git
git clone --depth 1 https://github.com/emscripten-core/emsdk.git "$GITHUB_WORKSPACE/emsdk"
cd "$GITHUB_WORKSPACE/emsdk"
./emsdk install latest
./emsdk activate latest
- name: Build WASM
run: |
source "$GITHUB_WORKSPACE/emsdk/emsdk_env.sh"
emcc --version
make basic-wasm basic-wasm-modular basic-wasm-canvas
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Playwright
run: |
pip install -r tests/requirements-wasm.txt
python -m playwright install chromium --with-deps
- name: Run WASM browser smoke tests
run: |
python3 tests/wasm_browser_test.py
python3 tests/wasm_browser_canvas_test.py
python3 tests/wasm_canvas_charset_test.py
python3 tests/wasm_tutorial_embed_test.py
- name: Package WASM artifact
run: |
mkdir -p out/wasm
cp web/basic.js web/basic.wasm web/index.html out/wasm/
cp web/basic-modular.js web/basic-modular.wasm out/wasm/
cp web/tutorial-embed.js web/tutorial-example.html web/vfs-helpers.js out/wasm/
cp web/basic-canvas.js web/basic-canvas.wasm web/canvas.html out/wasm/
cp web/README.md out/wasm/
cd out
tar czf rgc-basic-wasm.tar.gz wasm
- name: Upload WASM artifact
uses: actions/upload-artifact@v4
with:
name: rgc-basic-wasm
path: out/rgc-basic-wasm.tar.gz
release:
name: Release tagged build
needs: [build, wasm]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: dist/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}