diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..3a63760d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,57 @@ +name: Test Suite + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + name: Run Test Suite + runs-on: ubuntu-latest + + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - 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: 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 structured-classes + + - name: Install Node.js dependencies + run: npm ci + + - name: Run test suite + run: python test_all.py + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-results + path: | + tests/generated/ + tests/c/*.bin + tests/cpp/*.bin + tests/py/*.bin + retention-days: 5 diff --git a/README.md b/README.md index 9eafc832..322fe520 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,22 @@ python tests/run_tests.py --generate-only See `tests/README.md` for detailed test documentation. +### Continuous Integration + +The project uses GitHub Actions to automatically run the full test suite on: +- Every push to the `main` branch +- Every pull request targeting the `main` branch + +The CI pipeline: +1. Sets up Python 3.11 and Node.js 20 +2. Installs system dependencies (GCC, G++) +3. Installs Python dependencies (proto-schema-parser, structured-classes) +4. Installs Node.js dependencies +5. Runs the complete test suite (`python test_all.py`) +6. Uploads test artifacts for debugging + +You can view test results in the "Actions" tab of the GitHub repository. Test artifacts (generated code and binary files) are available for download for 5 days after each run. + ## Framing System Struct Frame provides a message framing system for reliable communication over serial links, network sockets, or any byte stream. Framing solves the fundamental problem of determining where messages begin and end in a continuous data stream.