Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: build

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
MKN_KUL_GIT_CO: --depth 1

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- env:
MKN_LIB_LINK_LIB: 1
run: |
curl -Lo mkn https://github.com/mkn/mkn/releases/download/latest/mkn_nix
chmod +x mkn
KLOG=2 ./mkn clean build run -dtOa "-std=c++20 -fPIC"
KLOG=2 ./mkn clean build run -dtOa "-std=c++20 -fPIC" -p test

macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- env:
MKN_LIB_LINK_LIB: 1
run: |
curl -Lo mkn https://github.com/mkn/mkn/releases/download/latest/mkn_arm_osx
chmod +x mkn
KLOG=2 ./mkn clean build run -dtOa "-std=c++20 -fPIC"
KLOG=2 ./mkn clean build run -tOa "-std=c++20 -fPIC" -p test

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64

- env:
MKN_CL_PREFERRED: 1
shell: cmd
run: | # /bin/link interferes with cl/link.exe
bash -c "rm /bin/link"
bash -c 'curl -Lo mkn.exe https://github.com/mkn/mkn/releases/download/latest/mkn.exe'
bash -c 'KLOG=2 ./mkn clean build run -dtOa "-EHsc -std:c++20"'
bash -c 'KLOG=2 ./mkn clean build run -tOa "-EHsc -std:c++20" -p test'
23 changes: 0 additions & 23 deletions .github/workflows/build_nix.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/build_osx.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/build_win.yml

This file was deleted.

2 changes: 1 addition & 1 deletion mkn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ profile:
dep: mkn&${maiken_location}(${maiken_scm})[mod]
if_arg:
win_shared: -DYAML_CPP_DLL
shared: -DKUL_SHARED
shared: -DMKN_KUL_SHARED

- name: test
parent: base
Expand Down
28 changes: 20 additions & 8 deletions test.cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@

#include <maiken.hpp>

#include "mkn/kul/signal.hpp"
#include "mkn/kul/yaml.hpp"

#include <maiken.hpp>
std::string const yArgs = "";

int main() {
kul::Signal sig;
int main(int argc, char* argv[]) {
KOUT(NON) << __FILE__;
mkn::kul::Signal sig;
try {
char* argv[]{"program", "-R"};
YAML::Node node = mkn::kul::yaml::String(yArgs).root();
char* argv2[2] = {argv[0], (char*)"-O"};
char* argv3[3] = {argv[0], (char*)"-Op", (char*)"test"};
auto app = (maiken::Application::CREATE(2, argv2))[0];
auto loader(maiken::ModuleLoader::LOAD(*app));
loader->module()->link(*app, node);
auto appTest = (maiken::Application::CREATE(3, argv3))[0];
loader->module()->init(*appTest, node);
loader->module()->compile(*appTest, node);
loader->module()->link(*appTest, node);
loader->module()->pack(*appTest, node);
loader->unload();
} catch (const kul::Exception& e) {
KERR << e.what();
} catch (mkn::kul::Exception const& e) {
KLOG(ERR) << e.what();
return 2;
} catch (const std::exception& e) {
} catch (std::exception const& e) {
KERR << e.what();
return 3;
} catch (...) {
KERR << "UNKNOWN EXCEPTION TYPE CAUGHT";
return 5;
}
return 0;
}
Loading