From 20504efcf36fe7c690645cc7bd546a6f2e3b0eb4 Mon Sep 17 00:00:00 2001 From: ValKmjolnir Date: Mon, 26 Aug 2024 00:30:27 +0800 Subject: [PATCH 1/4] :memo: update docs --- README.md | 1 + doc/README_zh.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 78d0b99..e5e29cc 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,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 e77f655..ea6a5e8 100644 --- a/doc/README_zh.md +++ b/doc/README_zh.md @@ -75,6 +75,7 @@ Windows 平台的预览版解释器现在还没配置相关流水线, 确保 thread model 是 `posix thread model`, 否则没有 thread 库。 +> mkdir build; > mingw32-make nasal.exe -j4 ### __Windows 平台 (Vistual Studio)__ From c9c6b905eab04ba38a88c54d489465ba6d812c66 Mon Sep 17 00:00:00 2001 From: ValKmjolnir Date: Wed, 11 Dec 2024 20:13:49 +0800 Subject: [PATCH 2/4] :memo: adjust CI --- .github/workflows/c-cpp.yml | 6 +----- .github/workflows/test.yml | 35 +++++++++++++++++++++++++++++++++++ README.md | 1 + doc/README_zh.md | 1 + test/hexdump.nas | 2 +- 5 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/test.yml 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..2fe1712 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,35 @@ +name: Nightly Build + +on: + push: + branches: [ master, develop ] + pull_request: + branches: [ master ] + workflow_dispatch: + +jobs: + mac-aarch64-build: + 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-build: + 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/README.md b/README.md index 027b5ed..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) diff --git a/doc/README_zh.md b/doc/README_zh.md index 9a64b6b..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) 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; }(); From fc6f7c60c7defaade98595031e8188be062969ec Mon Sep 17 00:00:00 2001 From: ValKmjolnir Date: Wed, 11 Dec 2024 20:15:58 +0800 Subject: [PATCH 3/4] :memo: adjust CI name --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2fe1712..329941f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Nightly Build +name: Nasal Interpreter Test on: push: @@ -8,7 +8,7 @@ on: workflow_dispatch: jobs: - mac-aarch64-build: + mac-aarch64: runs-on: macos-latest steps: - uses: actions/checkout@v4 @@ -21,7 +21,7 @@ jobs: - name: Test run: make test - linux-x86_64-build: + linux-x86_64: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From c784b7b49058c87e90694347ca463739d3ec31d0 Mon Sep 17 00:00:00 2001 From: ValKmjolnir Date: Wed, 11 Dec 2024 20:17:37 +0800 Subject: [PATCH 4/4] :memo: adjust build config --- CMakeLists.txt | 4 ++++ makefile | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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/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