test: audit cpp against the protocol conformance matrix, wire its tests into CI #484
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, dev] | |
| pull_request: | |
| branches: [main, dev] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - name: Install ruff | |
| run: pip install ruff | |
| - name: Check formatting | |
| run: ruff format --check . | |
| - name: Lint | |
| run: ruff check . --output-format=github | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11', '3.12'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements-ci.txt | |
| - name: Run tests | |
| run: | | |
| pytest --tb=short -q \ | |
| --cov=concore_cli --cov=concore_base \ | |
| --cov-report=term-missing \ | |
| --ignore=measurements/ \ | |
| --ignore=0mq/ \ | |
| --ignore=ratc/ \ | |
| --ignore=linktest/ | |
| julia-test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| julia-version: ['1.10', '1'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - uses: julia-actions/setup-julia@v3 | |
| with: | |
| version: ${{ matrix.julia-version }} | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements-ci.txt | |
| - name: Run Julia tests | |
| run: julia --color=yes tests/julia/runtests.jl | |
| shell: bash | |
| julia-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: julia-actions/setup-julia@v3 | |
| with: | |
| version: '1.10' | |
| - name: Install documentation dependencies | |
| run: julia --project=docs -e 'using Pkg; Pkg.instantiate()' | |
| - name: Build Julia documentation | |
| run: julia --project=docs docs/make.jl | |
| julia-matlab-verilog-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set interop directory | |
| run: echo "CONCORE_INTEROP_DIR=$RUNNER_TEMP/concore-matlab-interop" >> "$GITHUB_ENV" | |
| - uses: julia-actions/setup-julia@v3 | |
| with: | |
| version: '1.10' | |
| - name: Install Icarus Verilog | |
| run: sudo apt-get update && sudo apt-get install -y iverilog | |
| - name: Run Verilog interop tests | |
| run: julia --color=yes tests/julia/test_verilog_interop.jl | |
| - uses: matlab-actions/setup-matlab@v3 | |
| - name: Write Julia data for MATLAB | |
| run: julia --color=yes tests/julia/test_matlab_interop.jl write | |
| - name: Run MATLAB interop tests | |
| uses: matlab-actions/run-command@v3 | |
| with: | |
| command: addpath(pwd); addpath(fullfile(pwd, 'tests', 'matlab')); test_julia_interop | |
| - name: Read MATLAB data from Julia | |
| run: julia --color=yes tests/julia/test_matlab_interop.jl read | |
| - name: Remove interop files | |
| if: always() | |
| run: rm -rf "$CONCORE_INTEROP_DIR" | |
| java-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Download jeromq | |
| run: | | |
| curl -fsSL -o jeromq.jar https://repo1.maven.org/maven2/org/zeromq/jeromq/0.6.0/jeromq-0.6.0.jar | |
| - name: Compile Java tests | |
| run: | | |
| javac -cp jeromq.jar ConcoreJavaRuntimeCore.java concore.java concoredocker.java TestLiteralEval.java TestConcoredockerApi.java TestConcoreApi.java | |
| - name: Run Java tests | |
| run: | | |
| java -cp .:jeromq.jar TestLiteralEval | |
| java -cp .:jeromq.jar TestConcoredockerApi | |
| java -cp .:jeromq.jar TestConcoreApi | |
| docker-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check if Dockerfile.py changed | |
| uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| dockerfile: | |
| - 'Dockerfile.py' | |
| - 'requirements.txt' | |
| - name: Validate Dockerfile build | |
| if: steps.filter.outputs.dockerfile == 'true' | |
| run: docker build -f Dockerfile.py -t concore-py-test . | |
| cpp-shm-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install g++ | |
| run: sudo apt-get update && sudo apt-get install -y g++ | |
| - name: Parse concore.hpp standalone | |
| # -fsyntax-only parses concore.hpp without producing an object | |
| # file, so we don't need system SHM semaphores or shared-memory | |
| # segments to succeed. This catches header-level regressions on | |
| # the SHM transport (issue #195) without needing g++ at runtime. | |
| run: g++ -std=c++17 -Wall -Wextra -I. -fsyntax-only tests/test_shm_cpp_smoke.cpp | |
| - name: Build and run C++ parser tests | |
| run: | | |
| g++ -std=c++11 -Wall -Wextra -I. -o TestLiteralEvalCpp TestLiteralEvalCpp.cpp | |
| ./TestLiteralEvalCpp | |
| - name: Build and run C++ Concore API tests | |
| run: | | |
| g++ -std=c++11 -Wall -Wextra -I. -o TestConcoreHpp TestConcoreHpp.cpp | |
| ./TestConcoreHpp |