From e35516dc36e7500233df9b8c74e6e849411a93ed Mon Sep 17 00:00:00 2001 From: G-J van Rooyen Date: Mon, 2 Sep 2024 21:14:14 +0200 Subject: [PATCH] Updated GHA to support the latest Odin version --- .github/workflows/test.yml | 18 ++++++++++++------ bin/run-test.sh | 2 +- exercises/practice/grains/grains.odin | 2 +- .../resistor-color/resistor_color.odin | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b90c5c5..30c8ef4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,20 +13,26 @@ jobs: runs-on: ubuntu-22.04 steps: - - name: Update packages - run: sudo apt update + - name: Download Clang + run: wget https://apt.llvm.org/llvm.sh - - name: Install Clang - run: sudo apt -y install clang + - name: Set install script permissions + run: chmod u+x llvm.sh + + - name: Install Clang 18 + run: sudo ./llvm.sh 18 + + - name: Setup default version + run: sudo ln /usr/bin/clang-18 /usr/bin/clang - name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - name: Setup Odin - uses: laytan/setup-odin@41f9612bfec760bbb68b05b5747f319afe7c48d8 + uses: laytan/setup-odin@3df60bd622575fda7efa4a3ec928f446bcae1a0a with: token: ${{ secrets.GITHUB_TOKEN }} - llvm-version: 14 + llvm-version: 18 - name: Verify all exercises run: bin/verify-exercises diff --git a/bin/run-test.sh b/bin/run-test.sh index 53d94de..14a0d6c 100755 --- a/bin/run-test.sh +++ b/bin/run-test.sh @@ -63,7 +63,7 @@ function run_test() { # double-check that the example didn't accidentally get duplicated as the stub, this isn't # too critical for now. - if odin test ${tmp_path} ; then + if odin test ${tmp_path} 2> /dev/null ; then echo -e '\nERROR: The stub solution must not pass the tests!\n' exit 1 else diff --git a/exercises/practice/grains/grains.odin b/exercises/practice/grains/grains.odin index 9309232..aee82dc 100644 --- a/exercises/practice/grains/grains.odin +++ b/exercises/practice/grains/grains.odin @@ -1,6 +1,6 @@ package grains -Error :: enum {}// Please inspect the tests to see which error states to enumerate here. +Error :: enum {} // Please inspect the tests to see which error states to enumerate here. // Returns the number of grains on the specified square. diff --git a/exercises/practice/resistor-color/resistor_color.odin b/exercises/practice/resistor-color/resistor_color.odin index 70b2607..20a9853 100644 --- a/exercises/practice/resistor-color/resistor_color.odin +++ b/exercises/practice/resistor-color/resistor_color.odin @@ -1,6 +1,6 @@ package resistor_color -Color :: enum {}// Implement an enumeration of all the resistor colors. +Color :: enum {} // Implement an enumeration of all the resistor colors. code :: proc(color: Color) -> int {