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
36 changes: 36 additions & 0 deletions .github/workflows/maze-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and Test MazeSolver

on:
push:
branches: [ release/stm32maze ]
pull_request:
branches: [ release/stm32maze ]

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

# ubuntu-latest ships with GCC and Make — no setup action needed

- name: Build project (debug)
run: make

- name: Run maze solver
run: ./build/mazealgo

- name: Build project (release / -O2)
run: |
make clean
make CFLAGS+=' -O2'

- name: Upload build artifacts
uses: actions/upload-artifact@v4
if: always() # capture artifacts even on failure
with:
name: mazealgo-build
path: build/
retention-days: 7
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
SRCS = astar.c floodfill.c main.c
OBJS = $(patsubst %.c,build/%.o,$(SRCS))
DEPS = $(OBJS:.o=.d)
TARGET = build/mazealgo
CC ?= gcc

CFLAGS = -Wall -Wextra -Werror -std=c11 -Og -g -pedantic
CFLAGS += -Wconversion -Wshadow -Wformat=2 -fstack-protector-strong

-include $(DEPS)

build/mazealgo: $(OBJS)
$(CC) -o $@ $^ $(CFLAGS)
build/%.o: %.c
mkdir -p build
$(CC) -MMD -MP -c $< -o $@ $(CFLAGS)
.PHONY: clean help
clean:
rm -rf build

help:
@echo "This project is built using 'make' (see Makefile)."
@echo "If the README still refers to CMake-based builds, those instructions are legacy."
@echo "To build the binary used by CI, run: make"
@echo "To clean build artifacts, run: make clean"
6 changes: 6 additions & 0 deletions astar.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "astar.h"

void astar(void)
{

}
5 changes: 5 additions & 0 deletions astar.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#ifndef ASTAR_H
#define ASTAR_H

void astar(void);
#endif
6 changes: 6 additions & 0 deletions floodfill.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "floodfill.h"

void floodfill(void)
{

}
6 changes: 6 additions & 0 deletions floodfill.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef FLOODFILL_H
#define FLOODFILL_H

void floodfill(void);

#endif
11 changes: 11 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "astar.h"
#include "floodfill.h"

int main(int argc, char** argv)
{
(void)argc;
(void)argv;
floodfill();
astar();
return 0;
}
Loading