mirror of
https://github.com/thewesker/RASCSI.git
synced 2025-12-20 20:31:24 -05:00
Workflow integration (#29)
* Updated makefile to only rebuild changed files. Also generates dependency listings to check for modified header files * Updated workflow to archive the generated binaries and build fullspec and standard versions of the app * Updated to run workflow on all branches * Create tar file to retain file permissions * Fix archive path * Fix typo * Remove unnecessary git ignore * Added reference to issue that drives the need for nested compressed files. Co-authored-by: akuker <akuker@gmail.com>
This commit is contained in:
29
.github/workflows/c-cpp.yml
vendored
29
.github/workflows/c-cpp.yml
vendored
@@ -1,10 +1,6 @@
|
|||||||
name: C/C++ CI
|
name: C/C++ CI
|
||||||
|
|
||||||
on:
|
on: [push, pull_request]
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -15,10 +11,29 @@ jobs:
|
|||||||
- name: Install cross compile toolchain
|
- name: Install cross compile toolchain
|
||||||
run: sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf
|
run: sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: make
|
|
||||||
run: make all DEBUG=1
|
- name: make standard
|
||||||
|
run: make all DEBUG=1 CONNECT_TYPE=STANDARD
|
||||||
working-directory: ./src/raspberrypi
|
working-directory: ./src/raspberrypi
|
||||||
|
|
||||||
|
- name: make fullspec
|
||||||
|
run: make all DEBUG=1 CONNECT_TYPE=FULLSPEC
|
||||||
|
working-directory: ./src/raspberrypi
|
||||||
|
|
||||||
|
# We need to tar the binary outputs to retain the executable
|
||||||
|
# file permission. Currently, actions/upload-artifact only
|
||||||
|
# supports .ZIP files.
|
||||||
|
# This is workaround for https://github.com/actions/upload-artifact/issues/38
|
||||||
|
- name: tar binary outputs
|
||||||
|
run: tar -czvf rascsi.tar.gz ./bin
|
||||||
|
working-directory: ./src/raspberrypi
|
||||||
|
|
||||||
|
- name: upload artifacts
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: arm-binaries
|
||||||
|
path: ./src/raspberrypi/rascsi.tar.gz
|
||||||
|
|
||||||
# buildroot-image:
|
# buildroot-image:
|
||||||
# runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
# steps:
|
# steps:
|
||||||
|
|||||||
3
src/raspberrypi/.gitignore
vendored
3
src/raspberrypi/.gitignore
vendored
@@ -1,4 +1,3 @@
|
|||||||
*.o
|
|
||||||
*.bak
|
*.bak
|
||||||
*.HDA
|
*.HDA
|
||||||
*.save
|
*.save
|
||||||
@@ -10,3 +9,5 @@ scsimon
|
|||||||
rasctl
|
rasctl
|
||||||
sasidump
|
sasidump
|
||||||
rasdump
|
rasdump
|
||||||
|
obj
|
||||||
|
bin
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ else
|
|||||||
CXXFLAGS += -O3 -Wall -Werror
|
CXXFLAGS += -O3 -Wall -Werror
|
||||||
BUILD_TYPE = Release
|
BUILD_TYPE = Release
|
||||||
endif
|
endif
|
||||||
CFLAGS += -iquote .
|
CFLAGS += -iquote . -MD -MP
|
||||||
CXXFLAGS += -std=c++14 -iquote .
|
CXXFLAGS += -std=c++14 -iquote . -MD -MP
|
||||||
|
|
||||||
# If its not specified, build for STANDARD configuration
|
# If its not specified, build for STANDARD configuration
|
||||||
CONNECT_TYPE ?= STANDARD
|
CONNECT_TYPE ?= STANDARD
|
||||||
@@ -39,8 +39,8 @@ USR_LOCAL_BIN = /usr/local/bin
|
|||||||
MAN_PAGE_DIR = /usr/share/man/man1
|
MAN_PAGE_DIR = /usr/share/man/man1
|
||||||
DOC_DIR = ../../doc
|
DOC_DIR = ../../doc
|
||||||
|
|
||||||
OBJDIR := ./obj
|
OBJDIR := ./obj/$(shell echo $(CONNECT_TYPE) | tr '[:upper:]' '[:lower:]')
|
||||||
BINDIR := ./bin
|
BINDIR := ./bin/$(shell echo $(CONNECT_TYPE) | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
#BIN_ALL = $(RASCSI) $(RASCTL) $(RASDUMP) $(SASIDUMP) $(SCSIMON)
|
#BIN_ALL = $(RASCSI) $(RASCTL) $(RASDUMP) $(SASIDUMP) $(SCSIMON)
|
||||||
# Temporarily remove the RASDUMP and RASDUMP tools, since they're not needed
|
# Temporarily remove the RASDUMP and RASDUMP tools, since they're not needed
|
||||||
@@ -58,8 +58,8 @@ SRC_RASCSI = \
|
|||||||
# rasctl_command.cpp
|
# rasctl_command.cpp
|
||||||
# rascsi_mgr.cpp
|
# rascsi_mgr.cpp
|
||||||
# command_thread.cpp
|
# command_thread.cpp
|
||||||
SRC_RASCSI += $(notdir $(shell find ./controllers -name '*.cpp'))
|
SRC_RASCSI += $(shell find ./controllers -name '*.cpp')
|
||||||
SRC_RASCSI += $(notdir $(shell find ./devices -name '*.cpp'))
|
SRC_RASCSI += $(shell find ./devices -name '*.cpp')
|
||||||
|
|
||||||
SRC_RASCTL = \
|
SRC_RASCTL = \
|
||||||
rasctl.cpp
|
rasctl.cpp
|
||||||
@@ -85,26 +85,27 @@ vpath %.o ./$(OBJDIR)
|
|||||||
vpath ./$(BINDIR)
|
vpath ./$(BINDIR)
|
||||||
|
|
||||||
|
|
||||||
OBJ_RASCSI := $(SRC_RASCSI:%.cpp=$(OBJDIR)/%.o)
|
OBJ_RASCSI := $(addprefix $(OBJDIR)/,$(notdir $(SRC_RASCSI:%.cpp=%.o)))
|
||||||
OBJ_RASCTL := $(SRC_RASCTL:%.cpp=$(OBJDIR)/%.o)
|
OBJ_RASCTL := $(addprefix $(OBJDIR)/,$(notdir $(SRC_RASCTL:%.cpp=%.o)))
|
||||||
OBJ_RASDUMP := $(SRC_RASDUMP:%.cpp=$(OBJDIR)/%.o)
|
OBJ_RASDUMP := $(addprefix $(OBJDIR)/,$(notdir $(SRC_RASDUMP:%.cpp=%.o)))
|
||||||
OBJ_SASIDUMP := $(SRC_SASIDUMP:%.cpp=$(OBJDIR)/%.o)
|
OBJ_SASIDUMP := $(addprefix $(OBJDIR)/,$(notdir $(SRC_SASIDUMP:%.cpp=%.o)))
|
||||||
OBJ_SCSIMON := $(SRC_SCSIMON:%.cpp=$(OBJDIR)/%.o)
|
OBJ_SCSIMON := $(addprefix $(OBJDIR)/,$(notdir $(SRC_SCSIMON:%.cpp=%.o)))
|
||||||
#OBJ_ALL := $(OBJ_RASCSI) $(OBJ_RASCTL) $(OBJ_RASDUMP) $(OBJ_SASIDUMP) $(OBJ_SCSIMON)
|
#OBJ_ALL := $(OBJ_RASCSI) $(OBJ_RASCTL) $(OBJ_RASDUMP) $(OBJ_SASIDUMP) $(OBJ_SCSIMON)
|
||||||
OBJ_ALL := $(OBJ_RASCSI) $(OBJ_RASCTL) $(OBJ_RASDUMP) $(OBJ_SASIDUMP)
|
OBJ_ALL := $(OBJ_RASCSI) $(OBJ_RASCTL) $(OBJ_RASDUMP) $(OBJ_SASIDUMP)
|
||||||
|
|
||||||
|
|
||||||
|
# The following will include all of the auto-generated dependency files (*.d)
|
||||||
|
# if they exist. This will trigger a rebuild of a source file if a header changes
|
||||||
|
ALL_DEPS := $(patsubst %.o,%.d,$(OBJ_RASCSI) $(OBJ_RASCTL))
|
||||||
|
-include $(ALL_DEPS)
|
||||||
|
|
||||||
$(OBJDIR) $(BINDIR):
|
$(OBJDIR) $(BINDIR):
|
||||||
|
echo Creating directory $@
|
||||||
mkdir -p $@
|
mkdir -p $@
|
||||||
|
|
||||||
$(OBJDIR)/%.o: %.cpp $(OBJDIR)
|
$(OBJDIR)/%.o: %.cpp | $(OBJDIR)
|
||||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||||
|
|
||||||
# $(OBJDIR)/%.o: %.c
|
|
||||||
# $(CXX) $(CXXFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
# %.o: %.cpp
|
|
||||||
# $(CXX) $(CXXFLAGS) -c $(OBJDIR)/$< -o $@
|
|
||||||
|
|
||||||
.DEFAULT_GOAL := all
|
.DEFAULT_GOAL := all
|
||||||
.PHONY: all ALL docs
|
.PHONY: all ALL docs
|
||||||
all: $(BIN_ALL) docs
|
all: $(BIN_ALL) docs
|
||||||
@@ -112,12 +113,10 @@ ALL: all
|
|||||||
|
|
||||||
docs: $(DOC_DIR)/rascsi_man_page.txt $(DOC_DIR)/rasctl_man_page.txt
|
docs: $(DOC_DIR)/rascsi_man_page.txt $(DOC_DIR)/rasctl_man_page.txt
|
||||||
|
|
||||||
$(BINDIR)/$(RASCSI): $(OBJ_RASCSI) $(BINDIR)
|
$(BINDIR)/$(RASCSI): $(OBJ_RASCSI) | $(BINDIR)
|
||||||
@echo -- Linking $(RASCSI)
|
|
||||||
$(CXX) -o $@ $(OBJ_RASCSI) -lpthread
|
$(CXX) -o $@ $(OBJ_RASCSI) -lpthread
|
||||||
|
|
||||||
$(BINDIR)/$(RASCTL): $(OBJ_RASCTL) $(BINDIR)
|
$(BINDIR)/$(RASCTL): $(OBJ_RASCTL) $(BINDIR)
|
||||||
@echo -- Linking $(RASCTL)
|
|
||||||
$(CXX) -o $@ $(OBJ_RASCTL)
|
$(CXX) -o $@ $(OBJ_RASCTL)
|
||||||
|
|
||||||
$(RASDUMP): $(OBJ_RASDUMP) $(BINDIR)
|
$(RASDUMP): $(OBJ_RASDUMP) $(BINDIR)
|
||||||
|
|||||||
Reference in New Issue
Block a user