Skip to content

Commit

Permalink
Add workflow in test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gvrooyen committed Aug 23, 2024
1 parent 41c644f commit 4f70d44
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 18 deletions.
21 changes: 15 additions & 6 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: odin / Test

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

jobs:
ci:
runs-on: <image-name>
runs-on: ubuntu-20.04

steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: Use <setup tooling>
uses: <action to setup tooling>
- name: Setup Odin
uses: laytan/setup-odin@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
release: dev-2024-08
llvm-version: 14

- name: Install project dependencies
run: <install dependencies>
run: bin/fetch-configlet

- name: Run the project linter
run: bin/configlet lint

- name: Verify all exercises
run: bin/verify-exercises
run: bin/run-test.sh


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Official Exercism forum thread about this track: https://forum.exercism.org/t/new-track-odin-programming-language/7379

Borring concepts from other C-based/C-adjacent language tracks:
Borrowing concepts from other C-based/C-adjacent language tracks:
- https://github.com/exercism/c
- https://github.com/exercism/zig

Expand Down
6 changes: 3 additions & 3 deletions bin/gen-exercise.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ EOL
# Make the example file a simple copy of the solution file
cp ${solution_file} ${example_file}

echo "Formatting new Odin files:"
bin/odinfmt -w ${exercises_path}
# echo "Formatting new Odin files:"
# bin/odinfmt -w ${exercises_path}

echo "Be sure to implement the following files:"
echo -e "\t${solution_file}"
Expand All @@ -110,4 +110,4 @@ EOL

echo "Running configlet lint:"
bin/configlet lint
fi
fi
18 changes: 18 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@
"name": "Leap",
"practices": [],
"prerequisites": [],
"difficulty": 2
},
{
"uuid": "ce45a52e-0541-4384-8abf-b787bd49cbf7",
"slug": "difference-of-squares",
"name": "Difference Of Squares",
"practices": [],
"prerequisites": [],
"difficulty": 1
}
]
Expand All @@ -67,6 +75,16 @@
"title": "Cross-compile",
"content": "Odin can build for a plethora of targets and cross-compiling is a first class use case.",
"icon": "cross-platform"
},
{
"title": "Modern",
"content": "Odin is designed from the bottom up for the modern computer.",
"icon": "powerful"
},
{
"title": "Fun",
"content": "Odin is the C alternative for the Joy of Programming.",
"icon": "fun"
}
],
"tags": [
Expand Down
8 changes: 4 additions & 4 deletions exercises/practice/difference-of-squares/.meta/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"authors": [],
"authors": ["gvrooyen"],
"files": {
"solution": [],
"test": [],
"example": []
"solution": ["difference_of_squares.odin"],
"test": ["difference_of_squares_test.odin"],
"example": [".meta/difference_of_squares_example.odin"]
},
"blurb": "Find the difference between the square of the sum and the sum of the squares of the first N natural numbers.",
"source": "Problem 6 at Project Euler",
Expand Down
8 changes: 4 additions & 4 deletions exercises/practice/leap/.meta/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"authors": [],
"authors": ["gvrooyen"],
"files": {
"solution": [],
"test": [],
"example": []
"solution": ["leap.odin"],
"test": ["leap_test.odin"],
"example": [".meta/leap_example.odin"]
},
"blurb": "Determine whether a given year is a leap year.",
"source": "CodeRanch Cattle Drive, Assignment 3",
Expand Down

0 comments on commit 4f70d44

Please sign in to comment.