Skip to content

Commit

Permalink
Add GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexodia committed Jan 15, 2024
1 parent cc6e883 commit 042fe8c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: build

on: [push, pull_request]

jobs:
riscvm:
# Skip building pull requests from the same repository
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build and test
run: |
cd riscvm
cmake -B build -T ClangCL
cmake --build build --config Debug --parallel
./build/Debug/tests.exe
3 changes: 2 additions & 1 deletion riscvm/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main(int argc, char** argv)
printf("[%s] ", test.name);
if (test.size > sizeof(g_code))
{
printf("ERROR (too big)\n", test.name);
printf("ERROR (too big)\n");
continue;
}
total++;
Expand Down Expand Up @@ -68,4 +68,5 @@ int main(int argc, char** argv)
}
}
printf("\n%d/%d tests successful (%.2f%%)\n", successful, total, successful * 1.0f / total * 100);
return successful == total ? EXIT_SUCCESS : EXIT_FAILURE;
}

0 comments on commit 042fe8c

Please sign in to comment.