Skip to content

fix: Update benchmarks for comparison. #76

fix: Update benchmarks for comparison.

fix: Update benchmarks for comparison. #76

Workflow file for this run

name: CI/CD
on:
push:
branches: [ "main" ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
env:
CARGO_TERM_COLOR: always
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v6
- name: Configure WASM tooling
run: |
rustup target add wasm32-unknown-unknown
rustup component add llvm-tools-preview
cargo install trunk wasm-bindgen-cli cargo-llvm-cov
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '25'
cache: 'npm'
- name: Install Node dependencies
run: |
npm install -g @azure/static-web-apps-cli
npm ci
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install Python dependencies
working-directory: tests/e2e
run: uv sync
- name: Install Playwright browsers
working-directory: tests/e2e
run: uv run playwright install chromium --with-deps
- name: Quality - Code Formatting
run: cargo fmt --check
- name: Quality - Unit Tests with Coverage
run: cargo llvm-cov --html
- name: Upload Code Coverage Report
if: always()
uses: actions/upload-artifact@v7
with:
name: code-coverage-report
path: target/llvm-cov/html/
retention-days: 30
- name: Build Application
run: |
trunk build --release
- name: Start WASM Application Server
run: |
python3 -m http.server 8080 --directory ./dist &
echo $! > .server.pid
timeout 30 bash -c 'until curl -s http://localhost:8080 > /dev/null; do sleep 1; done'
echo "Server started on http://localhost:8080"
- name: Run E2E Tests
working-directory: tests/e2e
run: |
uv run pytest tests/
- name: Upload E2E Screenshots
if: failure()
uses: actions/upload-artifact@v7
with:
name: e2e-screenshots
path: tests/e2e/screenshots/
retention-days: 7
- name: Stop WASM Application Server
if: always()
run: |
if [ -f .server.pid ]; then
kill $(cat .server.pid) || true
rm .server.pid
fi
- name: Sign in to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_DEPLOYMENT_APP_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_DEPLOYMENT_APP_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_DEPLOYMENT_APP_SUBSCRIPTION_ID }}
- name: Deploy Azure Deployment Stack
id: deploystack
uses: azure/bicep-deploy@v2
with:
type: deploymentStack
operation: create
name: stack-countdown-solver
description: Countdown Solver Deployment Stack
location: westeurope
scope: resourceGroup
subscription-id: ${{ secrets.AZURE_DEPLOYMENT_APP_SUBSCRIPTION_ID }}
resource-group-name: rg-countdown-solver
template-file: ./deploy/main.bicep
action-on-unmanage-resources: delete
deny-settings-mode: denyWriteAndDelete
deny-settings-excluded-principals: ${{ secrets.DENY_SETTINGS_EXCLUDED_PRINCIPAL }}
deny-settings-apply-to-child-scopes: true
- name: Deploy to Azure Static Web App
run: |
deploymentToken=$(az staticwebapp secrets list --name ${{ steps.deploystack.outputs.staticWebAppName }} --query "properties.apiKey" -o tsv)
swa deploy ./dist --env production --deployment-token $deploymentToken --swa-config-location .