Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 173 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
validate:
name: Validate Exercises
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Run validation tests
run: bun test tests/exercises/validation.test.ts

- name: Run JavaScript/TypeScript syntax tests
run: bun test tests/exercises/syntax/javascript.test.ts

python:
name: Python Syntax
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: bun install

- name: Run Python syntax tests
run: bun test tests/exercises/syntax/python.test.ts

rust:
name: Rust Syntax
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Install dependencies
run: bun install

- name: Run Rust syntax tests
run: bun test tests/exercises/syntax/rust.test.ts

swift:
name: Swift Syntax
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Verify Swift
run: swiftc --version

- name: Install dependencies
run: bun install

- name: Run Swift syntax tests
run: bun test tests/exercises/syntax/swift.test.ts

kotlin:
name: Kotlin Syntax
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "21"

- name: Setup Kotlin
run: |
curl -L https://github.com/JetBrains/kotlin/releases/download/v2.0.0/kotlin-compiler-2.0.0.zip -o kotlin.zip
unzip kotlin.zip
echo "$PWD/kotlinc/bin" >> $GITHUB_PATH

- name: Verify Kotlin
run: kotlinc -version

- name: Install dependencies
run: bun install

- name: Run Kotlin syntax tests
run: bun test tests/exercises/syntax/kotlin.test.ts --timeout 300000

web:
name: HTML/CSS Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Run HTML/CSS tests
run: bun test tests/exercises/syntax/html-css.test.ts

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: bun install

- name: Type check server
run: bun x tsc --noEmit -p tsconfig.json

- name: Build Angular app
run: bun run build:prod

all-tests:
name: All Tests Pass
needs: [validate, python, rust, swift, kotlin, web, build]
runs-on: ubuntu-latest
steps:
- name: All tests passed
run: echo "All CI checks passed successfully!"
4 changes: 2 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kB",
"maximumError": "4kB"
"maximumWarning": "4kB",
"maximumError": "6kB"
}
],
"outputHashing": "all"
Expand Down
8 changes: 8 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"id": "01-temperature-converter",
"title": "Temperature Converter",
"description": "Build a program that converts temperatures between Celsius and Fahrenheit.\n\n## Requirements\n\n1. Create a variable to hold a temperature in Celsius\n2. Convert it to Fahrenheit using the formula: `F = C * 9/5 + 32`\n3. Print both temperatures with labels\n4. Use string templates for the output\n\n## Formula Reference\n\n- Celsius to Fahrenheit: `F = C * 9/5 + 32`\n- Fahrenheit to Celsius: `C = (F - 32) * 5/9`\n\n## Expected Output\n\n```\n25.0°C = 77.0°F\n```",
"order": 1,
"language": "kotlin",
"starterCode": "fun main() {\n // Create a val for the Celsius temperature\n\n // Calculate Fahrenheit\n\n // Print the result using string templates\n}",
"testCases": [
{
"description": "Should output temperature conversion",
"expectedOutput": "25.0°C = 77.0°F"
}
],
"hints": [
"Use `val` since the temperature won't change:"
]
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"id": "02-string-formatter",
"title": "String Formatter",
"description": "Build a program that formats and displays user information using string templates and operations.\n\n## Requirements\n\n1. Create variables for: first name, last name, age, and city\n2. Create a formatted full name (uppercase last name)\n3. Print a formatted introduction using string templates\n4. Calculate and print birth year (approximate)\n\n## Expected Output\n\n```\nName: Kyntrin LASTNAME\nAge: 25\nCity: Your City\nBirth Year: 2001\nIntroduction: Hello! I'm Kyntrin LASTNAME, 25 years old, from Your City.\n```",
"order": 2,
"language": "kotlin",
"starterCode": "fun main() {\n // Create your variables here\n val firstName = \"Kyntrin\"\n\n // Create formatted full name (uppercase last name)\n\n // Calculate birth year (current year - age)\n\n // Print all the information\n}",
"testCases": [
{
"description": "Should format the greeting correctly",
"expectedOutput": "Hello"
},
{
"description": "Should include the name",
"expectedOutput": "World"
}
],
"hints": [
"For simplicity, you can hardcode it:"
]
}
Loading