ci: add proper ci
Clang Lint CI / lint-no-video (push) Successful in 1m4s
Clang Build CI / run-video (push) Successful in 1m23s
Clang Build CI / run-no-video (push) Successful in 1m23s
Clang Build CI / build-release (push) Successful in 1m59s
Clang Lint CI / lint-video (push) Successful in 1m53s
Clang Lint CI / lint-no-video (push) Successful in 1m4s
Clang Build CI / run-video (push) Successful in 1m23s
Clang Build CI / run-no-video (push) Successful in 1m23s
Clang Build CI / build-release (push) Successful in 1m59s
Clang Lint CI / lint-video (push) Successful in 1m53s
This commit is contained in:
@@ -0,0 +1,74 @@
|
|||||||
|
name: Clang Build CI
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: build-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/build.yml'
|
||||||
|
- 'src/*.c'
|
||||||
|
- 'src/*.h'
|
||||||
|
- 'configure.ac'
|
||||||
|
- 'Makefile.am'
|
||||||
|
|
||||||
|
env:
|
||||||
|
GCC_ARGS: src/*.c src/*.h -lglfw -lGL -lm -lasound -Iinclude hashmap.c/hashmap.c log.c/src/log.c -DGLFW_INCLUDE_NONE -DGLFW_NATIVE_INCLUDE_NONE
|
||||||
|
GCC_ARGS_VIDEO: -DGLFW_EXPOSE_NATIVE_EGL -DVIDEO_IN
|
||||||
|
PACKAGES: "libglfw3-dev libgl-dev libasound2-dev"
|
||||||
|
PACKAGES_VIDEO: "libv4l-dev"
|
||||||
|
TARGET: forge
|
||||||
|
TEST_ARGS: "--help"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install packages
|
||||||
|
run: apt update && apt install -y $PACKAGES $PACKAGES_VIDEO
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
submodules: 'true'
|
||||||
|
- name: aclocal
|
||||||
|
run: aclocal
|
||||||
|
- name: autoconf
|
||||||
|
run: autoconf
|
||||||
|
- name: automake
|
||||||
|
run: automake --add-missing
|
||||||
|
- name: configure
|
||||||
|
run: ./configure
|
||||||
|
- name: make
|
||||||
|
run: make
|
||||||
|
- name: make distcheck
|
||||||
|
run: make distcheck
|
||||||
|
|
||||||
|
run-no-video:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install packages
|
||||||
|
run: apt update && apt install -y $PACKAGES
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
submodules: 'true'
|
||||||
|
- name: gcc
|
||||||
|
run: mkdir -p build && gcc $GCC_ARGS -o build/$TARGET
|
||||||
|
- name: run program
|
||||||
|
run: ./build/$TARGET $TEST_ARGS
|
||||||
|
|
||||||
|
run-video:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install packages
|
||||||
|
run: apt update && apt install -y $PACKAGES $PACKAGES_VIDEO
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
submodules: 'true'
|
||||||
|
- name: gcc
|
||||||
|
run: mkdir -p build && gcc $GCC_ARGS $GCC_ARGS_VIDEO -o build/$TARGET
|
||||||
|
- name: run program
|
||||||
|
run: ./build/$TARGET $TEST_ARGS
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
name: C-lang CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: ["master"]
|
|
||||||
pull_request:
|
|
||||||
branches: ["master"]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
- name: install libs
|
|
||||||
run: sudo apt install -y libglfw3-dev libgl-dev libv4l-dev libasound2-dev libbsd-dev
|
|
||||||
- name: gcc
|
|
||||||
run: mkdir -p build && gcc -v -Wall -Wextra -Werror -Wno-format-truncation src/*.c src/*.h -lglfw -lGL -lm -lasound -lbsd -Iinclude hashmap.c/hashmap.c log.c/src/log.c -DGLFW_INCLUDE_NONE -DGLFW_EXPOSE_NATIVE_EGL -DGLFW_NATIVE_INCLUDE_NONE -DVIDEO_IN
|
|
||||||
|
|
||||||
build-no-video:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
- name: install libs
|
|
||||||
run: sudo apt install -y libglfw3-dev libgl-dev libasound2-dev libbsd-dev
|
|
||||||
- name: gcc
|
|
||||||
run: mkdir -p build && gcc -v -Werror src/*.c src/*.h -lglfw -lGL -lm -lasound -lbsd -Iinclude hashmap.c/hashmap.c log.c/src/log.c -DGLFW_INCLUDE_NONE -DGLFW_EXPOSE_NATIVE_EGL -DGLFW_NATIVE_INCLUDE_NONE
|
|
||||||
|
|
||||||
build-release:
|
|
||||||
needs: lint
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
- name: install libs
|
|
||||||
run: sudo apt install -y libglfw3-dev libgl-dev libv4l-dev libasound2-dev libbsd-dev
|
|
||||||
- name: aclocal
|
|
||||||
run: aclocal
|
|
||||||
- name: autoconf
|
|
||||||
run: autoconf
|
|
||||||
- name: automake
|
|
||||||
run: automake --add-missing
|
|
||||||
- name: configure
|
|
||||||
run: ./configure
|
|
||||||
- name: make
|
|
||||||
run: make
|
|
||||||
- name: make distcheck
|
|
||||||
run: make distcheck
|
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
name: Clang Lint CI
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: lint-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/lint.yml'
|
||||||
|
- 'src/*.c'
|
||||||
|
- 'src/*.h'
|
||||||
|
|
||||||
|
env:
|
||||||
|
GCC_ARGS: src/*.c src/*.h -lglfw -lGL -lm -lasound -Iinclude hashmap.c/hashmap.c log.c/src/log.c -DGLFW_INCLUDE_NONE -DGLFW_NATIVE_INCLUDE_NONE
|
||||||
|
GCC_ARGS_VIDEO: -DGLFW_EXPOSE_NATIVE_EGL -DVIDEO_IN
|
||||||
|
PACKAGES: "libglfw3-dev libgl-dev libasound2-dev"
|
||||||
|
PACKAGES_VIDEO: "libv4l-dev"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint-no-video:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install packages
|
||||||
|
run: apt update && apt install -y $PACKAGES
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
submodules: 'true'
|
||||||
|
- name: gcc
|
||||||
|
run: gcc -Wall -Wextra -Werror -Wno-format-truncation -Wno-unused-parameter $GCC_ARGS
|
||||||
|
|
||||||
|
lint-video:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install packages
|
||||||
|
run: apt update && apt install -y $PACKAGES $PACKAGES_VIDEO
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
submodules: 'true'
|
||||||
|
- name: gcc
|
||||||
|
run: gcc -Wall -Wextra -Werror -Wno-format-truncation $GCC_ARGS $GCC_ARGS_VIDEO
|
||||||
+2
-1
@@ -26,4 +26,5 @@ confdeps.*
|
|||||||
conftest.*
|
conftest.*
|
||||||
*.txt
|
*.txt
|
||||||
error.glsl
|
error.glsl
|
||||||
draft/
|
draft/
|
||||||
|
*.gch
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ AUTOMAKE_OPTIONS = foreign subdir-objects -Wall
|
|||||||
bin_PROGRAMS = forge
|
bin_PROGRAMS = forge
|
||||||
forge_SOURCES = src/args.c src/arr.c src/config_file.c src/file.c src/forge.c src/main.c src/midi.c src/project.c src/rand.c src/shaders.c src/shared.c src/state.c src/string.c src/tempo.c src/timer.c src/video.c src/window.c $(top_srcdir)/include/glad/gl.h $(top_srcdir)/include/glad/egl.h $(top_srcdir)/hashmap.c/hashmap.c $(top_srcdir)/log.c/src/log.c
|
forge_SOURCES = src/args.c src/arr.c src/config_file.c src/file.c src/forge.c src/main.c src/midi.c src/project.c src/rand.c src/shaders.c src/shared.c src/state.c src/string.c src/tempo.c src/timer.c src/video.c src/window.c $(top_srcdir)/include/glad/gl.h $(top_srcdir)/include/glad/egl.h $(top_srcdir)/hashmap.c/hashmap.c $(top_srcdir)/log.c/src/log.c
|
||||||
forge_CFLAGS = -Ofast -march=native -flto -funroll-loops -fprefetch-loop-arrays -fno-exceptions -fopenmp -I$(top_srcdir)/include -DGLFW_INCLUDE_NONE -DGLFW_EXPOSE_NATIVE_EGL -DGLFW_NATIVE_INCLUDE_NONE -DLOG_USE_COLOR -DVIDEO_IN -DDATADIR=\"$(datadir)/$(PACKAGE)\"
|
forge_CFLAGS = -Ofast -march=native -flto -funroll-loops -fprefetch-loop-arrays -fno-exceptions -fopenmp -I$(top_srcdir)/include -DGLFW_INCLUDE_NONE -DGLFW_EXPOSE_NATIVE_EGL -DGLFW_NATIVE_INCLUDE_NONE -DLOG_USE_COLOR -DVIDEO_IN -DDATADIR=\"$(datadir)/$(PACKAGE)\"
|
||||||
forge_LDADD = -lm -lGL -lglfw -lasound -lbsd
|
forge_LDADD = -lm -lGL -lglfw -lasound
|
||||||
include_HEADERS = src/args.h src/arr.h src/config.h src/config_file.h src/constants.h src/file.h src/forge.h src/main.h src/midi.h src/project.h src/rand.h src/shaders.h src/shared.h src/state.h src/string.h src/tempo.h src/timer.h src/types.h src/video.h src/window.h $(top_srcdir)/include/glad/gl.h $(top_srcdir)/include/glad/egl.h $(top_srcdir)/include/linmath.h $(top_srcdir)/include/hashmap.h $(top_srcdir)/include/log.h
|
include_HEADERS = src/args.h src/arr.h src/config.h src/config_file.h src/constants.h src/file.h src/forge.h src/main.h src/midi.h src/project.h src/rand.h src/shaders.h src/shared.h src/state.h src/string.h src/tempo.h src/timer.h src/types.h src/video.h src/window.h $(top_srcdir)/include/glad/gl.h $(top_srcdir)/include/glad/egl.h $(top_srcdir)/include/linmath.h $(top_srcdir)/include/hashmap.h $(top_srcdir)/include/log.h
|
||||||
|
|
||||||
EXTRA_DIST = default/forge_project.cfg default/frag1.glsl default/frag10.glsl default/frag2.glsl default/frag3.glsl default/frag4.glsl default/frag5.glsl default/frag6.glsl default/frag7.glsl default/frag8.glsl default/frag9.glsl default/inc_cp437.glsl default/inc_debug.glsl default/inc_functions.glsl default/inc_fx.glsl default/inc_magic.glsl default/inc_rand.glsl default/inc_res.glsl default/inc_sentences.glsl default/inc_src.glsl default/inc_template.glsl default/inc_time.glsl default/inc_yuyv.glsl
|
EXTRA_DIST = default/forge_project.cfg default/frag1.glsl default/frag10.glsl default/frag2.glsl default/frag3.glsl default/frag4.glsl default/frag5.glsl default/frag6.glsl default/frag7.glsl default/frag8.glsl default/frag9.glsl default/inc_cp437.glsl default/inc_debug.glsl default/inc_functions.glsl default/inc_fx.glsl default/inc_magic.glsl default/inc_rand.glsl default/inc_res.glsl default/inc_sentences.glsl default/inc_src.glsl default/inc_template.glsl default/inc_time.glsl default/inc_yuyv.glsl
|
||||||
confdir = $(prefix)/share/$(PACKAGE)
|
confdir = $(prefix)/share/$(PACKAGE)
|
||||||
conf_DATA = default/forge_project.cfg default/frag1.glsl default/frag10.glsl default/frag2.glsl default/frag3.glsl default/frag4.glsl default/frag5.glsl default/frag6.glsl default/frag7.glsl default/frag8.glsl default/frag9.glsl default/inc_cp437.glsl default/inc_debug.glsl default/inc_functions.glsl default/inc_fx.glsl default/inc_magic.glsl default/inc_rand.glsl default/inc_res.glsl default/inc_sentences.glsl default/inc_src.glsl default/inc_template.glsl default/inc_time.glsl default/inc_yuyv.glsl
|
conf_DATA = default/forge_project.cfg default/frag1.glsl default/frag10.glsl default/frag2.glsl default/frag3.glsl default/frag4.glsl default/frag5.glsl default/frag6.glsl default/frag7.glsl default/frag8.glsl default/frag9.glsl default/inc_cp437.glsl default/inc_debug.glsl default/inc_functions.glsl default/inc_fx.glsl default/inc_magic.glsl default/inc_rand.glsl default/inc_res.glsl default/inc_sentences.glsl default/inc_src.glsl default/inc_template.glsl default/inc_time.glsl default/inc_yuyv.glsl
|
||||||
|
|||||||
+20
-20
@@ -14,7 +14,7 @@ build:
|
|||||||
-Iinclude \
|
-Iinclude \
|
||||||
hashmap.c/hashmap.c \
|
hashmap.c/hashmap.c \
|
||||||
log.c/src/log.c \
|
log.c/src/log.c \
|
||||||
-lm -lGL -lglfw -lasound -lbsd \
|
-lm -lGL -lglfw -lasound \
|
||||||
-Wall -Wextra \
|
-Wall -Wextra \
|
||||||
-Wno-format-truncation \
|
-Wno-format-truncation \
|
||||||
-DGLFW_INCLUDE_NONE \
|
-DGLFW_INCLUDE_NONE \
|
||||||
@@ -25,6 +25,24 @@ build:
|
|||||||
-o build/$(TARGET) \
|
-o build/$(TARGET) \
|
||||||
-g -Og
|
-g -Og
|
||||||
|
|
||||||
|
.PHONY: build-no-video
|
||||||
|
build-no-video:
|
||||||
|
@mkdir -p build
|
||||||
|
gcc \
|
||||||
|
src/*.h src/*.c \
|
||||||
|
-Iinclude \
|
||||||
|
hashmap.c/hashmap.c \
|
||||||
|
log.c/src/log.c \
|
||||||
|
-lm -lGL -lglfw -lasound \
|
||||||
|
-Wall -Wextra \
|
||||||
|
-Wno-format-truncation \
|
||||||
|
-Wno-unused-parameter \
|
||||||
|
-DGLFW_INCLUDE_NONE \
|
||||||
|
-DGLFW_NATIVE_INCLUDE_NONE \
|
||||||
|
-DLOG_USE_COLOR \
|
||||||
|
-o build/$(TARGET) \
|
||||||
|
-g -Og
|
||||||
|
|
||||||
.PHONY: format
|
.PHONY: format
|
||||||
format:
|
format:
|
||||||
clang-format -i src/*
|
clang-format -i src/*
|
||||||
@@ -50,25 +68,7 @@ valgrind: build
|
|||||||
|
|
||||||
.PHONY: clean-release
|
.PHONY: clean-release
|
||||||
clean-release:
|
clean-release:
|
||||||
@rm -rf \
|
git clone -f -x
|
||||||
autom4te.cache \
|
|
||||||
aclocal.m4 \
|
|
||||||
compile \
|
|
||||||
config.* \
|
|
||||||
configure \
|
|
||||||
configure~ \
|
|
||||||
depcomp \
|
|
||||||
**/.deps \
|
|
||||||
**/**/.deps \
|
|
||||||
$(TARGET) \
|
|
||||||
$(TARGET)-*.tar.gz \
|
|
||||||
$(TARGET)-*.pkg.tar.zst \
|
|
||||||
install-sh \
|
|
||||||
Makefile \
|
|
||||||
Makefile.in \
|
|
||||||
missing \
|
|
||||||
src/.* \
|
|
||||||
src/*.o
|
|
||||||
|
|
||||||
.PHONY: test-release
|
.PHONY: test-release
|
||||||
test-release: clean clean-release
|
test-release: clean clean-release
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[](https://github.com/klemek/forge-steel/releases) [](https://github.com/klemek/forge-steel/releases) [](https://github.com/klemek/forge-steel/commits/master/) [](https://github.com/klemek/forge-steel/actions/workflows/ci.yml) [](https://sonarcloud.io/summary/new_code?id=klemek_forge-steel) 
|
[](https://git.klemek.fr/klemek/forge-steel/actions?workflow=lint.yml) [](https://git.klemek.fr/klemek/forge-steel/actions?workflow=build.yml)
|
||||||
|
|
||||||
<!-- omit from toc -->
|
<!-- omit from toc -->
|
||||||
# F.O.R.G.E. (Steel)
|
# F.O.R.G.E. (Steel)
|
||||||
@@ -116,7 +116,6 @@ Here's a quick rundown of the process:
|
|||||||
| libGL | libgl-dev | extra/libglvnd |
|
| libGL | libgl-dev | extra/libglvnd |
|
||||||
| libasound | libasound2-dev | extra/alsa-lib |
|
| libasound | libasound2-dev | extra/alsa-lib |
|
||||||
| libv4l2 | libv4l-dev | extra/v4l-utils |
|
| libv4l2 | libv4l-dev | extra/v4l-utils |
|
||||||
| libbsd | libbsd-dev | extra/libbsd |
|
|
||||||
|
|
||||||
### From release
|
### From release
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -23,8 +23,6 @@ AC_CHECK_HEADERS([string.h])
|
|||||||
AC_CHECK_HEADERS([time.h])
|
AC_CHECK_HEADERS([time.h])
|
||||||
AC_CHECK_HEADERS([unistd.h])
|
AC_CHECK_HEADERS([unistd.h])
|
||||||
|
|
||||||
AC_CHECK_HEADERS([bsd/string.h])
|
|
||||||
|
|
||||||
AC_CHECK_HEADERS([linux/videodev2.h])
|
AC_CHECK_HEADERS([linux/videodev2.h])
|
||||||
|
|
||||||
AC_CHECK_HEADERS([alsa/rawmidi.h])
|
AC_CHECK_HEADERS([alsa/rawmidi.h])
|
||||||
@@ -33,4 +31,4 @@ AC_CHECK_HEADERS([GLFW/glfw3.h])
|
|||||||
AC_CHECK_HEADERS([GLFW/glfw3native.h])
|
AC_CHECK_HEADERS([GLFW/glfw3native.h])
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile])
|
AC_CONFIG_FILES([Makefile])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
+2
-1
@@ -48,6 +48,7 @@ bool check_glerror(ShaderProgram *program, const char *context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool check_eglerror_ro(const char *context) {
|
bool check_eglerror_ro(const char *context) {
|
||||||
|
#ifdef VIDEO_IN
|
||||||
unsigned int code;
|
unsigned int code;
|
||||||
|
|
||||||
code = eglGetError();
|
code = eglGetError();
|
||||||
@@ -56,7 +57,7 @@ bool check_eglerror_ro(const char *context) {
|
|||||||
log_warn("EGL Error: %04x (%s)", code, context);
|
log_warn("EGL Error: %04x (%s)", code, context);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif /* VIDEO_IN */
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user