-
Notifications
You must be signed in to change notification settings - Fork 0
Fix: Kotlin integration and code quality improvements #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ba9b747
Fix: Kotlin integration and code quality improvements
0xLeif 0695539
Fix: Address code review feedback
0xLeif 43d03e5
Fix: Remove redundant exists check and unnecessary null coalescing
0xLeif 67341e4
Fix: Exercise test execution and add timeout protection
0xLeif 9c61dad
Add: CI workflow and comprehensive test infrastructure
0xLeif 5f27838
Fix: TypeScript errors in test files
0xLeif cceedff
Fix: Make Rust/Kotlin syntax tests informational
0xLeif e305de9
Fix: Swift syntax test timeout and make informational
0xLeif dd44267
Fix: Remove unused imports from exercise-loader
0xLeif File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| 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!" |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
...ent/courses/kotlin/modules/01-kotlin-fundamentals/exercises/01-temperature-converter.json
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
| 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:" | ||
| ] | ||
| } |
87 changes: 0 additions & 87 deletions
87
...ses/kotlin/modules/01-kotlin-fundamentals/exercises/01-temperature-converter.md
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
content/courses/kotlin/modules/01-kotlin-fundamentals/exercises/02-string-formatter.json
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
| 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:" | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.