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
13 changes: 8 additions & 5 deletions .github/workflows/livecode_ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
name: Livecode (Code Sanity Check & Test)

on: [ push, pull_request ]
on:
push:
pull_request:
workflow_dispatch:

jobs:
sanity_check:
runs-on: ubuntu-latest
name: Sanity Check
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Installing dependencies
Expand All @@ -23,8 +26,8 @@ jobs:
runs-on: ubuntu-latest
name: Test Cases
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Installing Dependencies
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ LIVECODE_PORT?=8010

default: run

setup:
build-c-runtime:
docker build -t fossunited/falcon-c ./runtimes/c

setup: build-c-runtime
docker pull fossunited/falcon-python:3.9
docker pull fossunited/falcon-golang
docker pull fossunited/falcon-rust
Expand Down
5 changes: 5 additions & 0 deletions livecode_server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
"command": [],
"code_filename": "main.go"
},
"c": {
"image": "fossunited/falcon-c",
"command": [],
"code_filename": "main.c"
},
"joy": {
"image": "falcon-joy",
"command": ["python", "/opt/start.py"],
Expand Down
9 changes: 9 additions & 0 deletions runtimes/c/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM debian:bullseye-slim
RUN apt-get update && \
apt-get install -y build-essential && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY run.sh /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/run.sh
WORKDIR /app
ENTRYPOINT ["/usr/local/bin/run.sh"]
8 changes: 8 additions & 0 deletions runtimes/c/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -e

SOURCE_FILE="main.c"
OUTPUT_BINARY="/tmp/a.out"

gcc "${SOURCE_FILE}" -o "${OUTPUT_BINARY}"
exec "${OUTPUT_BINARY}"
9 changes: 9 additions & 0 deletions tests/runtimes/test_c_hello.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
runtime: c
code: |
#include <stdio.h>
int main() {
printf("Hello from C runtime!\n");
return 0;
}
expected_output: "Hello from C runtime!\n"

Loading