Skip to content

Commit

Permalink
Setup Hello World exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
pfertyk committed Dec 4, 2023
1 parent 11503b0 commit 6831def
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 11 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Requires scripts:
# - bin/test

name: <track> / Test
name: GDScript / Test

on:
push:
Expand All @@ -23,17 +23,14 @@ on:

jobs:
ci:
runs-on: <image-name>
runs-on: ubuntu-22.04
container:
image: exercism/gdscript-test-runner

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Use <setup tooling>
uses: <action to setup tooling>

- name: Install project dependencies
run: <install dependencies>

- name: Verify all exercises
run: bin/verify-exercises
run: ls -la /opt/test-runner/bin && /opt/test-runner/bin/run.sh hello-world ./exercises/practice/hello-world/ /tmp && ls /tmp && cat /tmp/stderr
# TODO: detect all exercises
22 changes: 20 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"active": false,
"status": {
"concept_exercises": false,
"test_runner": false,
"test_runner": true,
"representer": false,
"analyzer": false
},
Expand All @@ -15,15 +15,33 @@
"indent_size": 4,
"highlightjs_language": "TODO: specify highlightjs language"
},
"test_runner": {
"average_run_time": 10
},
"files": {
"solution": [],
"test": [],
"example": [],
"exemplar": []
},
"files": {
"solution": ["%{snake_slug}.gd"],
"test": ["%{snake_slug}_test.gd"],
"example": [".meta/example.gd"],
"exemplar": [".meta/exemplar.gd"]
},
"exercises": {
"concept": [],
"practice": []
"practice": [
{
"uuid": "1adfc420-46f2-4d5b-93a3-165ede1fcd9f",
"slug": "hello-world",
"name": "Hello World",
"practices": [],
"prerequisites": [],
"difficulty": 1
}
]
},
"concepts": [],
"key_features": [],
Expand Down
16 changes: 16 additions & 0 deletions exercises/practice/hello-world/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Instructions

The classical introductory exercise.
Just say "Hello, World!".

["Hello, World!"][hello-world] is the traditional first program for beginning programming in a new language or environment.

The objectives are simple:

- Modify the provided code so that it produces the string "Hello, World!".
- Run the test suite and make sure that it succeeds.
- Submit your solution and check it at the website.

If everything goes well, you will be ready to fetch your first real exercise.

[hello-world]: https://en.wikipedia.org/wiki/%22Hello,_world!%22_program
17 changes: 17 additions & 0 deletions exercises/practice/hello-world/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"authors": [],
"files": {
"solution": [
"hello_world.gd"
],
"test": [
"hello_world_test.gd"
],
"example": [
".meta/example.gd"
]
},
"blurb": "The classical introductory exercise. Just say \"Hello, World!\".",
"source": "This is an exercise to introduce users to using Exercism",
"source_url": "https://en.wikipedia.org/wiki/%22Hello,_world!%22_program"
}
2 changes: 2 additions & 0 deletions exercises/practice/hello-world/.meta/example.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
func hello():
return "Hello, World!"
13 changes: 13 additions & 0 deletions exercises/practice/hello-world/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This is an auto-generated file.
#
# Regenerating this file via `configlet sync` will:
# - Recreate every `description` key/value pair
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
# - Preserve any other key/value pair
#
# As user-added comments (using the # character) will be removed when this file
# is regenerated, comments can be added via a `comment` key.

[af9ffe10-dc13-42d8-a742-e7bdafac449d]
description = "Say Hi!"
2 changes: 2 additions & 0 deletions exercises/practice/hello-world/hello_world.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
func hello():
return "Goodbye, Mars!"
2 changes: 2 additions & 0 deletions exercises/practice/hello-world/hello_world_test.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
func test_hello_world(solution_script):
return ["Hello, World!", solution_script.hello()]

0 comments on commit 6831def

Please sign in to comment.