Skip to content

Commit

Permalink
Added experimental macOS CI job
Browse files Browse the repository at this point in the history
  • Loading branch information
Ratstail91 committed Sep 21, 2024
1 parent ac89f80 commit b21dcc8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/continuous-integration-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,12 @@ jobs:
- uses: actions/checkout@v4
- name: make tests (windows)
run: make tests

test-macos-latest:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- name: make tests (macos)
run: make tests

12 changes: 11 additions & 1 deletion tests/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ CC=gcc
CFLAGS=-g -Wall -Werror -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable
LIBS=-lm

ifeq ($(shell uname),Linux)
LDFLAG=-Wl,--gc-sections
else ifeq ($(OS),Windows_NT)
LDFLAG=-Wl,--gc-sections
else ifeq ($(shell uname),Darwin)
LDFLAG=-Wl,-dead_strip
else
@echo "LDFLAG set failed - what platform is this?"
endif

#directories
TEST_ROOTDIR=..
TEST_SOURCEDIR=$(TEST_ROOTDIR)/$(TOY_SOURCEDIR)
Expand Down Expand Up @@ -41,7 +51,7 @@ $(TEST_OBJDIR)/%.o: $(TEST_CASESDIR)/%.c

#final linking step (with extra flags to strip dead code)
$(TEST_OUTDIR)/%.exe: $(TEST_OBJDIR)/%.o
@$(CC) -o $@ $< $(addprefix $(TEST_OBJDIR)/,$(notdir $(TEST_SOURCEFILES:.c=.o))) $(CFLAGS) $(LIBS) -Wl,--gc-sections
@$(CC) -o $@ $< $(addprefix $(TEST_OBJDIR)/,$(notdir $(TEST_SOURCEFILES:.c=.o))) $(CFLAGS) $(LIBS) $(LDFLAGS)
$@

#util commands
Expand Down

0 comments on commit b21dcc8

Please sign in to comment.