Skip to content

cleanup

cleanup #164

Workflow file for this run

name: CI
on:
push:
branches: [main]
paths:
- 'lib/**'
- 'test/**'
- 'mix.exs'
- 'mix.lock'
- '.github/workflows/ci.yml'
- 'scripts/**'
- 'examples/**'
pull_request:
branches: [main]
paths:
- 'lib/**'
- 'test/**'
- 'mix.exs'
- 'mix.lock'
- '.github/workflows/ci.yml'
- 'scripts/**'
- 'examples/**'
jobs:
test:
name: Test (Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }})
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
strategy:
matrix:
elixir: ['1.14', '1.15', '1.16']
otp: ['25', '26']
exclude:
- elixir: '1.14'
otp: '26'
env:
MIX_ENV: test
CI: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-
- name: Install dependencies
run: mix deps.get
- name: Compile
run: mix compile --warnings-as-errors
- name: Run tests (exclude slow)
run: |
mix test --exclude slow --exclude omnetpp \
--formatter JUnitFormatter \
--formatter ExUnit.CLIFormatter \
--slowest 10
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.elixir }}-${{ matrix.otp }}
path: _build/test/lib/gen_server_virtual_time/test-junit-report.xml
- name: Publish test report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '_build/test/lib/gen_server_virtual_time/test-junit-report.xml'
check_name: 'Test Report (Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }})'
detailed_summary: true
include_passed: true
coverage:
name: Coverage & All Tests
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.18'
otp-version: '27'
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-coverage-${{ hashFiles('**/mix.lock') }}
- name: Install dependencies
run: mix deps.get
- name: Run fast tests with coverage export
env:
MIX_ENV: test
run: mix coveralls --export-coverage fast
- name: Run slow tests with coverage export (for coverage completeness)
env:
MIX_ENV: test
continue-on-error: true
run: mix coveralls --only slow --export-coverage slow
- name: Run diagram generation tests with coverage export
env:
MIX_ENV: test
continue-on-error: true
run: mix coveralls --only diagram_generation --export-coverage diagram
- name: Merge coverage and report to GitHub
env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mix test.coverage
mix coveralls.github --import-cover cover
quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.18'
otp-version: '27'
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-quality-${{ hashFiles('**/mix.lock') }}
- name: Cache Dialyzer PLTs
uses: actions/cache@v4
with:
path: priv/plts
key: ${{ runner.os }}-dialyzer-1.18-27-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-dialyzer-1.18-27-
- name: Install dependencies
run: mix deps.get
- name: Run code quality checks
run: |
echo "🔍 Running code quality analysis"
echo "📊 Checking: formatting, Credo analysis, Dialyzer type checking"
echo ""
- name: Check formatting
run: mix format --check-formatted
- name: Run Credo
run: mix credo --strict
continue-on-error: true
- name: Run Dialyzer
run: mix dialyzer --format github
generated-vlingo:
name: Test Generated VLINGO XOOM Code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.18'
otp-version: '27'
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Install Elixir dependencies
run: mix deps.get
- name: Generate VLINGO sample project
run: mix run scripts/generate_vlingo_sample.exs
- name: Build VLINGO generated code
working-directory: generated/vlingo_loadbalanced
run: mvn clean compile
- name: Run VLINGO tests
working-directory: generated/vlingo_loadbalanced
run: mvn test
- name: Upload VLINGO test results
uses: actions/upload-artifact@v4
if: always()
with:
name: vlingo-test-results
path: generated/vlingo_loadbalanced/target/surefire-reports/*.xml
validate-generators:
name: Validate All Generator Scripts
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.18'
otp-version: '27'
- name: Install dependencies
run: mix deps.get
- name: Run OMNeT++ generator script
run: |
mix run scripts/generate_omnetpp_examples.exs
# Check that at least one file was generated
if [ ! -f "examples/omnetpp_pubsub/PubSubNetwork.ned" ]; then
echo "ERROR: OMNeT++ generator did not create expected files"
exit 1
fi
echo "✓ OMNeT++ generator: OK"
- name: Run CAF generator script
run: |
mix run scripts/generate_caf_examples.exs
# Check that at least one file was generated
if [ ! -f "examples/caf_pubsub/main.cpp" ]; then
echo "ERROR: CAF generator did not create expected files"
exit 1
fi
echo "✓ CAF generator: OK"
- name: Run Pony generator script
run: |
mix run scripts/generate_pony_examples.exs
# Check that at least one file was generated
if [ ! -f "generated/pony_loadbalanced/main.pony" ]; then
echo "ERROR: Pony generator did not create expected files"
exit 1
fi
echo "✓ Pony generator: OK"
- name: Run Phony generator script
run: |
mix run scripts/generate_phony_examples.exs
# Check that at least one file was generated
if [ ! -f "generated/phony_burst/main.go" ]; then
echo "ERROR: Phony generator did not create expected files"
exit 1
fi
echo "✓ Phony generator: OK"
- name: Run VLINGO generator script
run: |
mix run scripts/generate_vlingo_sample.exs
# Check that at least one file was generated
if [ ! -f "generated/vlingo_loadbalanced/pom.xml" ]; then
echo "ERROR: VLINGO generator did not create expected files"
exit 1
fi
echo "✓ VLINGO generator: OK"
- name: Run Ractor generator script
run: |
mix run examples/ractor_demo.exs
# Check that at least one file was generated
if [ ! -f "examples/ractor_burst/Cargo.toml" ]; then
echo "ERROR: Ractor generator did not create expected files"
exit 1
fi
echo "✓ Ractor generator: OK"
- name: Summary
run: |
echo "================================================"
echo "✅ All 6 generator scripts executed successfully"
echo "================================================"
echo "Generators validated:"
echo " ✓ OMNeT++ (C++ network simulation)"
echo " ✓ CAF (C++ actors)"
echo " ✓ Pony (capabilities-secure actors)"
echo " ✓ Phony (Go actors)"
echo " ✓ Ractor (Rust actors)"
echo " ✓ VLINGO XOOM (Java actors)"
echo "================================================"