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
50 changes: 46 additions & 4 deletions .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: 🏁 Linux Builds
on:
push:
branches: [ master, main, github_actions_brook ]
branches: [ master, main ]

env:
BUILD_TYPE: release

jobs:
windows-compilation:
linux-compilation:
name: Linux Compilation
runs-on: "ubuntu-20.04"
steps:
Expand Down Expand Up @@ -43,5 +43,47 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: win64
path: build/bin/
name: linux
path: build/bin/

linux-ink-proof:
name: Ink Proof Page Generation
runs-on: "ubuntu-latest"
needs: "linux-compilation"

steps:
# Checkout project with submodules
- uses: actions/checkout@v2
with:
submodules: true

# Download build result from previous step
- uses: actions/download-artifact@v2
with:
name: linux
path: build

# Setup python
- uses: actions/setup-python@v2
with:
python-version: '3.7'

# Run ink proof
- name: Build Ink Proof Website
shell: bash
run: |
cd $GITHUB_WORKSPACE/proofing/ink-proof
python3 install_deps.py
cp ../inkcpp_runtime_driver drivers/
chmod +x drivers/inkcpp_runtime_driver
mkdir deps/inkcpp
cp $GITHUB_WORKSPACE/build/bin/* deps/inkcpp/
chmod +x deps/inkcpp/inkcpp_cl
python3 proof.py --examples 'I0..' inkcpp inklecate_v0.9.0 --reference-runtime inkcpp

- name: Deploy Page
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: inkproof-page
FOLDER: proofing/ink-proof/out
2 changes: 1 addition & 1 deletion .github/workflows/macos_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: win64
name: macos
path: build/bin/
2 changes: 1 addition & 1 deletion .github/workflows/windows_builds.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 🏁 Windows Builds
on:
push:
branches: [ master, main, github_actions_brook ]
branches: [ master, main ]

env:
BUILD_TYPE: release
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "proofing/ink-proof"]
path = proofing/ink-proof
url = https://github.com/chromy/ink-proof.git
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# inkcpp
Inkle Ink C++ Runtime with JSON -> Binary Compiler.

Ink Proofing Test Results: https://brwarner.github.io/inkcpp

## Project Goals
* Fast, simple, clean syntax
* No heap allocations during execution (unless in emergencies)
Expand Down
24 changes: 22 additions & 2 deletions inkcpp_cl/inkcpp_cl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int main(int argc, const char** argv)
}
else
{
std::cerr << "Unrecognized option '" << option << "'\n";
std::cerr << "Unrecognized option: '" << option << "'\n";
}
}

Expand Down Expand Up @@ -87,13 +87,22 @@ int main(int argc, const char** argv)
std::string jsonFile = std::regex_replace(inputFilename, std::regex("\\.[^\\.]+$"), ".tmp");

// Then we need to do a compilation with inklecate
inklecate(inputFilename, jsonFile);
try
{
inklecate(inputFilename, jsonFile);
}
catch (const std::exception& e)
{
std::cerr << "Inklecate Error: " << e.what() << std::endl;
return 1;
}

// New input is the json file
inputFilename = jsonFile;
}

// Open file and compile
try
{
ink::compiler::compilation_results results;
std::ofstream fout(outputFilename, std::ios::binary | std::ios::out);
Expand All @@ -112,11 +121,17 @@ int main(int argc, const char** argv)
return -1;
}
}
catch (std::exception& e)
{
std::cerr << "Unhandled InkBin compiler exception: " << e.what() << std::endl;
return 1;
}

if (!playMode)
return 0;

// Run the story
try
{
using namespace ink::runtime;

Expand Down Expand Up @@ -152,4 +167,9 @@ int main(int argc, const char** argv)

return 0;
}
catch (const std::exception& e)
{
std::cerr << "Unhandled ink runtime exception: " << e.what() << std::endl;
return 1;
}
}
3 changes: 3 additions & 0 deletions proofing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
In the future, there'll be machinery in here to run the ink-proof tests as a test phase during build. For now, it just houses the ink-proof submodule so we can generate the HTML page for it on master.

See windows_builds.yml in the .github folder
1 change: 1 addition & 0 deletions proofing/ink-proof
Submodule ink-proof added at 6edca4
12 changes: 12 additions & 0 deletions proofing/inkcpp_runtime_driver
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env python3

import os
import sys
import shutil

ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PATH = os.path.join(ROOT, 'deps', 'inkcpp', 'inkcpp_cl')
ARGS = ["inkcpp_cl", "-p"] + sys.argv[1:]
os.execv(PATH, ARGS)
sleep(2)