Compare commits

...

7 Commits

Author SHA1 Message Date
CPunch 38d9c499ea whoops, wrong path to the workflow file 2023-08-30 21:30:20 -05:00
CPunch 79d40d4bb0 ig that runner doesn't work lol 2023-08-30 21:28:50 -05:00
CPunch dc44adba6e removed CERROR 2023-08-30 20:14:03 -05:00
CPunch 7c0bec5e6c allow manual runs 2023-08-30 20:12:06 -05:00
CPunch a44450ff22 wrong output path for windows build 2023-08-30 20:09:06 -05:00
CPunch 58c857d2ea oops 2023-08-30 20:03:30 -05:00
CPunch 38136d028f switched from appveyor to github workflow 2023-08-30 20:02:04 -05:00
7 changed files with 48 additions and 39 deletions

44
.github/workflows/check_build.yaml vendored Normal file
View File

@ -0,0 +1,44 @@
name: Check Builds
on:
push:
paths:
- src/**
- main.c
- Makefile
- CMakeLists.txt
- .github/workflows/check_build.yaml
workflow_dispatch:
jobs:
ubuntu-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: CMake
run: cmake -B build
- name: Build
run: cmake --build build
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: Cosmo-Ubuntu
path: bin
windows-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Create CMake build files
run: cmake -B build -DCMAKE_BUILD_TYPE=MinSizeRel
- name: Check compilation
run: cmake --build build --config MinSizeRel
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: Cosmo-Windows
path: bin

View File

@ -1,5 +1,5 @@
# Cosmo
[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/CPunch/Cosmo?svg=true)](https://ci.appveyor.com/project/CPunch/Cosmo)
[![Check Build](https://github.com/CPunch/Cosmo/actions/workflows/check_build.yaml/badge.svg?branch=main)](https://github.com/CPunch/Cosmo/actions/workflows/check_build.yaml)
## Usage

View File

@ -1,33 +0,0 @@
version: 'cosmo-0.1.{build}'
# we compile every commit under all branches
#branch:
# only:
# - main
# only run CI if we changed actual code
only_commits:
files:
- src/
- main.c
- Makefile
- CMakeLists.txt
- appveyor.yml
# images we're using
image:
- Ubuntu2004
platform:
- x64
install:
- sudo apt install clang cmake -y
build_script:
- make && ./bin/cosmo examples/testsuite.cosmo -s examples/getters_setters.cosmo
artifacts:
- path: bin
name: ubuntu20_04-bin-x64
type: zip

View File

@ -56,7 +56,7 @@ void *cosmoM_reallocate(CState *state, void *buf, size_t oldSize, size_t newSize
#endif
if (newBuf == NULL) {
CERROR("failed to allocate memory!");
printf("[ERROR] failed to allocate memory!");
exit(1);
}

View File

@ -64,6 +64,4 @@ typedef int (*cosmo_Writer)(CState *state, const void *data, size_t size, const
#define UNNAMEDCHUNK "_main"
#define COSMOASSERT(x) assert(x)
#define CERROR(err) printf("%s : %s\n", "[ERROR]", err)
#endif

View File

@ -32,7 +32,7 @@ CState *cosmoV_newState()
CState *state = malloc(sizeof(CState));
if (state == NULL) {
CERROR("failed to allocate memory!");
printf("[ERROR] failed to allocate memory!");
exit(1);
}

View File

@ -696,7 +696,7 @@ static inline uint16_t READUINT(CCallFrame *frame)
# define SWITCH switch (READBYTE(frame))
# define DEFAULT \
default: \
CERROR("unknown opcode!"); \
printf("[ERROR] unknown opcode!"); \
exit(0)
#endif