diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index b0375ad..c7fc759 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -1,12 +1,8 @@ -name: Build/Test/Package CI +name: Nightly Build on: schedule: - cron: "0 16 * * *" - push: - branches: [ master, develop ] - pull_request: - branches: [ master ] workflow_dispatch: jobs: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..329941f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,35 @@ +name: Nasal Interpreter Test + +on: + push: + branches: [ master, develop ] + pull_request: + branches: [ master ] + workflow_dispatch: + +jobs: + mac-aarch64: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Build + run: | + make -j4 + cd module + make all -j4 + cd .. + - name: Test + run: make test + + linux-x86_64: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build + run: | + make -j4 + cd module + make all -j4 + cd .. + - name: Test + run: make test diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a58c3d..69c03f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,10 @@ if(MSVC) add_compile_options(/utf-8) endif() +if (APPLE) + add_compile_options(-mmacosx-version-min=10.15) +endif() + # generate release executables set(CMAKE_BUILD_TYPE "Release") diff --git a/README.md b/README.md index 4145a47..119dbf4 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![license](https://img.shields.io/badge/license-GPLv2-green?style=flat-square&logo=github)](./LICENSE) ![downloads](https://img.shields.io/github/downloads/ValKmjolnir/Nasal-Interpreter/total.svg?style=flat-square&logo=github) [![C/C++ CI](https://github.com/ValKmjolnir/Nasal-Interpreter/actions/workflows/c-cpp.yml/badge.svg)](https://github.com/ValKmjolnir/Nasal-Interpreter/actions/workflows/c-cpp.yml) +[![Test CI](https://github.com/ValKmjolnir/Nasal-Interpreter/actions/workflows/test.yml/badge.svg)](https://github.com/ValKmjolnir/Nasal-Interpreter/actions/workflows/test.yml) > This document is also available in: [__中文__](./doc/README_zh.md) | [__English__](./README.md) @@ -82,6 +83,7 @@ Download the latest source of the interpreter and build it! It's quite easy to b Make sure thread model is `posix thread model`, otherwise no thread library exists. +> mkdir build; > mingw32-make nasal.exe -j4 ### __Windows (Visual Studio)__ diff --git a/doc/README_zh.md b/doc/README_zh.md index 77c47c8..b750837 100644 --- a/doc/README_zh.md +++ b/doc/README_zh.md @@ -6,6 +6,7 @@ [![license](https://img.shields.io/badge/license-GPLv2-green?style=flat-square&logo=github)](../LICENSE) ![downloads](https://img.shields.io/github/downloads/ValKmjolnir/Nasal-Interpreter/total.svg?style=flat-square&logo=github) [![C/C++ CI](https://github.com/ValKmjolnir/Nasal-Interpreter/actions/workflows/c-cpp.yml/badge.svg)](https://github.com/ValKmjolnir/Nasal-Interpreter/actions/workflows/c-cpp.yml) +[![Test CI](https://github.com/ValKmjolnir/Nasal-Interpreter/actions/workflows/test.yml/badge.svg)](https://github.com/ValKmjolnir/Nasal-Interpreter/actions/workflows/test.yml) > 这篇文档包含多语言版本: [__中文__](../doc/README_zh.md) | [__English__](../README.md) @@ -74,6 +75,7 @@ Windows 平台的预览版解释器现在还没配置相关流水线, 确保 thread model 是 `posix thread model`, 否则没有 thread 库。 +> mkdir build; > mingw32-make nasal.exe -j4 ### __Windows 平台 (Vistual Studio)__ diff --git a/makefile b/makefile index 7ffe405..4482512 100644 --- a/makefile +++ b/makefile @@ -295,7 +295,7 @@ clean: @ rm $(NASAL_OBJECT) .PHONY: test -test:nasal +test: @ ./nasal -t -d test/andy_gc_test.nas @ ./nasal test/argparse_test.nas @ ./nasal -e test/ascii-art.nas diff --git a/test/hexdump.nas b/test/hexdump.nas index cf5c66b..b6e96b6 100644 --- a/test/hexdump.nas +++ b/test/hexdump.nas @@ -37,7 +37,7 @@ var s = func() { } var ret=""; foreach(var elem;filename) - ret~=io.readfile(elem); + ret~=io.readfile("./src/" ~ elem); return ret; }();