Update mathbox.rs : clarifying "count-until" label #131
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 | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_TOOLCHAIN: stable | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: {} | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| env: | |
| RUSTFLAGS: -D warnings | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{env.RUST_TOOLCHAIN}} | |
| components: clippy, rustfmt | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| env-vars: "RUST_TOOLCHAIN=${{env.RUST_TOOLCHAIN}}" | |
| - name: check | |
| run: | | |
| cargo check --all-targets --all-features | |
| - name: clippy | |
| run: | | |
| cargo clippy --all-targets --all-features | |
| - name: rustfmt | |
| run: | | |
| cargo fmt --all --check | |
| test: | |
| needs: [check] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{env.RUST_TOOLCHAIN}} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| env-vars: "RUST_TOOLCHAIN=${{env.RUST_TOOLCHAIN}}" | |
| - name: Run tests | |
| run: cargo test --all-features | |
| test-e2e: | |
| needs: [check] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{env.RUST_TOOLCHAIN}} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| env-vars: "RUST_TOOLCHAIN=${{env.RUST_TOOLCHAIN}}" | |
| - uses: browser-actions/setup-chrome@v2 | |
| id: setup-chrome | |
| with: | |
| install-dependencies: true | |
| - name: Run browser smoke tests | |
| env: | |
| CHROME_BIN: ${{ steps.setup-chrome.outputs.chrome-path }} | |
| run: cargo test --test e2e -- --ignored --test-threads=1 | |
| test-js: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Run JS unit tests | |
| run: node --test tests/js/*.test.mjs | |
| lint-web: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: biomejs/setup-biome@v2 | |
| with: | |
| version: latest | |
| - name: Biome CI | |
| run: biome ci --error-on-warnings src/service | |
| dependencies-are-sorted: | |
| needs: [check] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{env.RUST_TOOLCHAIN}} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| env-vars: "RUST_TOOLCHAIN=${{env.RUST_TOOLCHAIN}}" | |
| - name: Install cargo-sort | |
| run: | | |
| cargo install cargo-sort 2>/dev/null || true | |
| - name: Check dependency tables | |
| working-directory: . | |
| run: | | |
| cargo sort --grouped --check | |
| lighthouse: | |
| needs: [check] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{env.RUST_TOOLCHAIN}} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| env-vars: "RUST_TOOLCHAIN=${{env.RUST_TOOLCHAIN}}" | |
| - uses: browser-actions/setup-chrome@v2 | |
| with: | |
| install-dependencies: true | |
| - name: Build server | |
| run: cargo build | |
| - name: Start server | |
| run: | | |
| ./target/debug/homework --http 127.0.0.1:8080 & | |
| echo "SERVER_PID=$!" >> "$GITHUB_ENV" | |
| for i in $(seq 1 20); do | |
| curl -sf http://127.0.0.1:8080/ > /dev/null && break | |
| sleep 0.5 | |
| done | |
| - name: Run Lighthouse accessibility audit | |
| run: | | |
| npx --yes lighthouse@12 http://127.0.0.1:8080/ \ | |
| --only-categories=accessibility \ | |
| --output=json \ | |
| --chrome-flags="--headless=new --no-sandbox --disable-dev-shm-usage" \ | |
| --quiet \ | |
| 2>/dev/null \ | |
| | jq -e '.categories.accessibility.score >= 0.9' | |
| npx --yes lighthouse@12 http://127.0.0.1:8080/1/multiplications \ | |
| --only-categories=accessibility \ | |
| --output=json \ | |
| --chrome-flags="--headless=new --no-sandbox --disable-dev-shm-usage" \ | |
| --quiet \ | |
| 2>/dev/null \ | |
| | jq -e '.categories.accessibility.score >= 0.9' | |
| - name: Stop server | |
| if: always() | |
| run: kill "$SERVER_PID" 2>/dev/null || true | |
| copyright-headers: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Check copyright headers | |
| run: | | |
| missing=$(grep -rL "Copyright (C) 2024-2026 Plabayo" src/ tests/ \ | |
| --include="*.rs" --include="*.css" --include="*.js" \ | |
| --exclude-dir=fixtures 2>/dev/null || true) | |
| if [ -n "$missing" ]; then | |
| echo "Missing copyright header in:" | |
| echo "$missing" | |
| exit 1 | |
| fi | |
| echo "All source files have copyright headers." | |
| deploy-fly: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - test | |
| - test-js | |
| - test-e2e | |
| - lighthouse | |
| - dependencies-are-sorted | |
| - lint-web | |
| - copyright-headers | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: superfly/flyctl-actions/setup-flyctl@master | |
| - run: flyctl deploy --remote-only | |
| env: | |
| FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |