aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yml29
-rw-r--r--Makefile8
-rw-r--r--README.md4
3 files changed, 37 insertions, 4 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..e278d5f
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,29 @@
+name: CI
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+
+env:
+ CROSS_COMPILE: riscv64-linux-gnu-
+ CC_SUFFIX: -14
+
+jobs:
+ test:
+ name: Continuous Integration
+ runs-on: ubuntu-24.04
+
+ steps:
+ - name: Checkout Code
+ uses: actions/checkout@v4
+
+ - name: Install dependencies from Ubuntu sources
+ run: sudo apt-get install clang-format gcc-14-riscv64-linux-gnu
+
+ - name: Lint
+ run: make lint V=1
+
+ - name: Check that it builds
+ run: make V=1
diff --git a/Makefile b/Makefile
index f969a1c..611ee48 100644
--- a/Makefile
+++ b/Makefile
@@ -17,8 +17,8 @@ endif
# I did not go too much into the rabbit hole of platform-specific flags. Hence
# no `-mcpu`, no `-mtune`, no funny business.
-CC = $(CROSS_COMPILE)gcc
-LD = $(CROSS_COMPILE)ld
+CC = $(CROSS_COMPILE)gcc$(CC_SUFFIX)
+LD = $(CROSS_COMPILE)ld
QEMU ?= qemu-system-riscv64
ISA ?= rv64imafdc_zicntr_zicsr_zifencei_zihpm_zca_zcd_zba_zbb
@@ -88,3 +88,7 @@ gdb:
.PHONY: clean
clean:
$(Q) rm -f $(OBJ) $(KRNL) $(LINKER)
+
+.PHONY: lint
+lint:
+ $(Q) git ls-files *.c *.h | xargs clang-format --dry-run --Werror
diff --git a/README.md b/README.md
index 532584b..da92c98 100644
--- a/README.md
+++ b/README.md
@@ -17,8 +17,8 @@ In order to build `fbos` you only need GCC. That being said, if you are not on a
RISC-V system you will also need cross compilation tools for it (check your
distribution for this, on openSUSE I simply installed `cross-riscv64-gcc14`).
With that installed, simply set the `CROSS_COMPILE` environment variable as
-you'd do for building the kernel (e.g. in my case, using openSUSE, I set it to
-`riscv64-suse-linux-`). After all of that, just:
+you'd do for building the Linux kernel (e.g. in my case, using openSUSE, I set
+it to `riscv64-suse-linux-`). After all of that, just:
```
$ make