diff options
| -rw-r--r-- | .github/workflows/ci.yml | 29 | ||||
| -rw-r--r-- | Makefile | 8 | ||||
| -rw-r--r-- | README.md | 4 |
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 @@ -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 @@ -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 |
