Skip to content

Opus review

Opus review #1094

Workflow file for this run

name: Test Suite
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
concurrency:
group: test-${{ github.sha }}
cancel-in-progress: true
jobs:
# Primary job: full suite on Ubuntu / pinned tool versions. Acts as the
# gating check and produces the canonical `test-results` artifact.
test:
name: Run Test Suite (ubuntu / py3.11 / node20 / dotnet10)
runs-on: ubuntu-latest
env:
SF_DOTNET_TFM: net10.0
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Set up .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
dotnet-quality: "preview"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc g++ build-essential
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install proto-schema-parser pytest hypothesis
- name: Install Node.js dependencies
run: npm ci
working-directory: tests/ts
- name: Run test suite
# --require-langs makes a missing toolchain a hard failure on this full
# matrix job, so a language can never be silently skipped and still
# report green (this job is expected to exercise all seven languages).
run: python test_all.py --require-langs c,cpp,py,ts,js,csharp,rust
- name: Check generated-file determinism
run: python tests/check_determinism.py --verbose
- name: Check wire-format goldens
run: python tests/check_golden.py --verbose
- name: Check test-coverage doc is up to date
run: python tests/gen_test_coverage.py --check
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
tests/generated/
tests/c/build/
tests/cpp/build/
tests/py/build/
retention-days: 5
# Cross-OS matrix: confirm the suite is portable to macOS. Each runner
# only exercises languages whose toolchains are present out of the box,
# so we drop .NET on macOS to avoid spending the matrix on installer flakes.
# Windows is intentionally not in the matrix — `tests/run_tests.py` uses
# POSIX-style shell quoting and many compile invocations would need
# individual debugging. Tracked as a follow-up.
os-matrix:
name: ${{ matrix.os }} (py3.11)
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os: [macos-latest]
steps:
- uses: actions/checkout@v4
with: { submodules: true }
- uses: actions/setup-python@v5
with: { python-version: "3.11" }
- uses: actions/setup-node@v4
with: { node-version: "20" }
- name: Install Python deps
run: pip install proto-schema-parser pytest
- name: Install Node deps
run: npm ci
working-directory: tests/ts
- name: Run test suite (skip C# — no .NET 10 SDK on macOS runner)
run: python test_all.py --skip-lang csharp
# Python version matrix: catch interpreter-specific regressions. We skip
# the heavier compiled-language phases via --skip-lang to keep wall time
# to ~ the time of the Python phase itself.
python-matrix:
name: python ${{ matrix.python }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
python: ["3.9", "3.11", "3.13"]
steps:
- uses: actions/checkout@v4
with: { submodules: true }
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/setup-node@v4
with: { node-version: "20" }
- name: Install Python deps
run: pip install proto-schema-parser pytest
- name: Install Node deps
run: npm ci
working-directory: tests/ts
- name: Run Python + C suite
run: python test_all.py --skip-lang csharp --skip-lang rust
# Node version matrix: focused JS/TS validation against supported LTS lines.
node-matrix:
name: node ${{ matrix.node }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
node: ["18", "20", "22"]
steps:
- uses: actions/checkout@v4
with: { submodules: true }
- uses: actions/setup-python@v5
with: { python-version: "3.11" }
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install Python deps
run: pip install proto-schema-parser pytest
- name: Install Node deps
run: npm ci
working-directory: tests/ts
- name: Run JS + TS suite
run: python test_all.py --skip-lang csharp --skip-lang rust
# .NET 8 compatibility lane.
dotnet-8:
name: dotnet 8.0.x
runs-on: ubuntu-latest
env:
SF_DOTNET_TFM: net8.0
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with: { submodules: true }
- uses: actions/setup-python@v5
with: { python-version: "3.11" }
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
dotnet-quality: "ga"
- name: Install Python deps
run: pip install proto-schema-parser pytest
- name: Run C# slice
run: python test_all.py --skip-lang rust
# .NET 10 compatibility lane.
dotnet-10:
name: dotnet 10.0.x
runs-on: ubuntu-latest
env:
SF_DOTNET_TFM: net10.0
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with: { submodules: true }
- uses: actions/setup-python@v5
with: { python-version: "3.11" }
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
dotnet-quality: "preview"
- name: Install Python deps
run: pip install proto-schema-parser pytest
- name: Run C# slice
run: python test_all.py --skip-lang rust
# Compiler matrix: GCC vs Clang for the C / C++ binaries.
compiler-matrix:
name: ${{ matrix.cc }} / ${{ matrix.cxx }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- cc: gcc
cxx: g++
pkg: gcc
- cc: clang
cxx: clang++
pkg: clang
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- uses: actions/checkout@v4
with: { submodules: true }
- uses: actions/setup-python@v5
with: { python-version: "3.11" }
- uses: actions/setup-node@v4
with: { node-version: "20" }
- name: Install compiler
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.pkg }} build-essential
pip install proto-schema-parser pytest hypothesis
(cd tests/ts && npm ci)
- name: Run C / C++ suite under ${{ matrix.cc }}
run: python test_all.py --skip-lang csharp --skip-lang rust