Simplify commands for jobs in push.yml (#1761)

* Simplify commands for build steps

* Fixing multi-lang builds for Pinecil & PinecilV2

* Makefile: fix multi-thread building support

* source/Makefile: fix formatting

---------

Co-authored-by: Ben V. Brown <5425387+Ralim@users.noreply.github.com>
This commit is contained in:
Ivan Zorin
2023-07-28 12:45:22 +03:00
committed by GitHub
parent 65ac2e25a6
commit 55d36c98f1
3 changed files with 22 additions and 31 deletions

View File

@@ -30,9 +30,7 @@ jobs:
run: cd source && ./build.sh -m ${{ matrix.model }} run: cd source && ./build.sh -m ${{ matrix.model }}
- name: Copy license files - name: Copy license files
run: | run: cp LICENSE scripts/LICENSE_RELEASE.md source/Hexfile/
cp LICENSE source/Hexfile/LICENSE
cp scripts/LICENSE_RELEASE.md source/Hexfile/LICENSE_RELEASE.md
- name: Archive ${{ matrix.model }} artifacts - name: Archive ${{ matrix.model }} artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@@ -47,7 +45,7 @@ jobs:
if-no-files-found: error if-no-files-found: error
- name: Generate json index file - name: Generate json index file
run: cd source && python3 metadata.py ${{ matrix.model }}.json run: ./source/metadata.py ${{ matrix.model }}.json
- name: Archive ${{ matrix.model }} index file - name: Archive ${{ matrix.model }} index file
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@@ -79,12 +77,10 @@ jobs:
run: git config --global --add safe.directory /__w/IronOS/IronOS && git config --global safe.directory "$GITHUB_WORKSPACE" run: git config --global --add safe.directory /__w/IronOS/IronOS && git config --global safe.directory "$GITHUB_WORKSPACE"
- name: Build ${{ matrix.model }} - name: Build ${{ matrix.model }}
run: cd source && make -j$(nproc) model="${{ matrix.model }}" firmware-multi_compressed_European firmware-multi_compressed_Bulgarian+Russian+Serbian+Ukrainian firmware-multi_Chinese+Japanese run: make -j$(nproc) model="${{ matrix.model }}" firmware-multi_compressed_European firmware-multi_compressed_Bulgarian+Russian+Serbian+Ukrainian firmware-multi_Chinese+Japanese
- name: Copy license files - name: Copy license files
run: | run: cp LICENSE scripts/LICENSE_RELEASE.md source/Hexfile/
cp LICENSE source/Hexfile/LICENSE
cp scripts/LICENSE_RELEASE.md source/Hexfile/LICENSE_RELEASE.md
- name: Archive ${{ matrix.model }} artifacts - name: Archive ${{ matrix.model }} artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@@ -99,7 +95,7 @@ jobs:
if-no-files-found: error if-no-files-found: error
- name: Generate json index file - name: Generate json index file
run: cd source && python3 metadata.py ${{ matrix.model }}_multi-lang.json run: ./source/metadata.py ${{ matrix.model }}_multi-lang.json
- name: Archive ${{ matrix.model }} index file - name: Archive ${{ matrix.model }} index file
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@@ -125,15 +121,10 @@ jobs:
run: python3 -m pip install bdflib run: python3 -m pip install bdflib
- name: Run python tests - name: Run python tests
run: cd Translations && chmod +x make_translation_test.py && ./make_translation_test.py run: ./Translations/make_translation_test.py
- name: Run BriefLZ tests - name: Run BriefLZ tests
run: | run: make -C source/ Objects/host/brieflz/libbrieflz.so && ./Translations/brieflz_test.py
cd source
make Objects/host/brieflz/libbrieflz.so
cd ../Translations
chmod +x brieflz_test.py
./brieflz_test.py
check_c-cpp: check_c-cpp:
@@ -150,7 +141,7 @@ jobs:
submodules: true submodules: true
- name: Check format style with clang-format - name: Check format style with clang-format
run: cd source && make clean && make check-style run: make clean check-style
check_python: check_python:

View File

@@ -140,7 +140,7 @@ test-py:
@echo "" @echo ""
flake8 Translations flake8 Translations
black --check Translations black --check Translations
@make -C source/ Objects/host/brieflz/libbrieflz.so @$(MAKE) -C source/ Objects/host/brieflz/libbrieflz.so
./Translations/brieflz_test.py ./Translations/brieflz_test.py
./Translations/make_translation_test.py ./Translations/make_translation_test.py
@@ -149,7 +149,7 @@ test-ccpp:
@echo "" @echo ""
@echo "---- Checking C/C++ code... ----" @echo "---- Checking C/C++ code... ----"
@echo "" @echo ""
make -C source/ clean check-style $(MAKE) -C source/ clean check-style
# meta target for tests & checks based on .github/workflows/push # meta target for tests & checks based on .github/workflows/push
tests: test-md test-sh test-py test-ccpp tests: test-md test-sh test-py test-ccpp
@@ -159,11 +159,11 @@ tests: test-md test-sh test-py test-ccpp
# pass-through target for Makefile inside source/ dir # pass-through target for Makefile inside source/ dir
%: %:
make -C source/ $@ $(MAKE) -C source/ $@
# global clean-up target for produced/generated files inside tree # global clean-up target for produced/generated files inside tree
clean-build: clean-build:
make -C source/ clean-all $(MAKE) -C source/ clean-all
rm -Rf site rm -Rf site
rm -Rf scripts/ci/artefacts rm -Rf scripts/ci/artefacts

View File

@@ -763,15 +763,15 @@ Core/Gen/Translation_brieflz.%.cpp: $(OUTPUT_DIR)/Core/Gen/translation.files/%.o
@test -d $(@D) || mkdir -p $(@D) @test -d $(@D) || mkdir -p $(@D)
@echo Generating BriefLZ compressed translation for $* @echo Generating BriefLZ compressed translation for $*
@OBJCOPY=$(OBJCOPY) $(HOST_PYTHON) ../Translations/make_translation.py \ @OBJCOPY=$(OBJCOPY) $(HOST_PYTHON) ../Translations/make_translation.py \
--macros $(PWD)/Core/Gen/macros.txt \ --macros $(CURDIR)/Core/Gen/macros.txt \
-o $(PWD)/Core/Gen/Translation_brieflz.$*.cpp \ -o $(CURDIR)/Core/Gen/Translation_brieflz.$*.cpp \
--input-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/$*.pickle \ --input-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/$*.pickle \
--strings-obj $(OUTPUT_DIR)/Core/Gen/translation.files/$*.o \ --strings-obj $(OUTPUT_DIR)/Core/Gen/translation.files/$*.o \
$* $*
Core/Gen/Translation_brieflz_font.%.cpp: $(OUTPUT_DIR)/Core/Gen/translation.files/%.pickle $(HOST_OUTPUT_DIR)/brieflz/libbrieflz.so Core/Gen/macros.txt Core/Gen/Translation_brieflz_font.%.cpp: $(OUTPUT_DIR)/Core/Gen/translation.files/%.pickle $(HOST_OUTPUT_DIR)/brieflz/libbrieflz.so Core/Gen/macros.txt
@test -d $(@D) || mkdir -p $(@D) @test -d $(@D) || mkdir -p $(@D)
@echo Generating BriefLZ compressed translation for $* @echo Generating BriefLZ compressed translation font for $*
@$(HOST_PYTHON) ../Translations/make_translation.py \ @$(HOST_PYTHON) ../Translations/make_translation.py \
--macros $(PWD)/Core/Gen/macros.txt \ --macros $(PWD)/Core/Gen/macros.txt \
-o $(PWD)/Core/Gen/Translation_brieflz_font.$*.cpp \ -o $(PWD)/Core/Gen/Translation_brieflz_font.$*.cpp \
@@ -818,8 +818,8 @@ Core/Gen/Translation_multi.$(1).cpp: $(patsubst %,../Translations/translation_%.
@test -d $(OUTPUT_DIR)/Core/Gen/translation.files || mkdir -p $(OUTPUT_DIR)/Core/Gen/translation.files @test -d $(OUTPUT_DIR)/Core/Gen/translation.files || mkdir -p $(OUTPUT_DIR)/Core/Gen/translation.files
@echo 'Generating translations for multi-language $(2)' @echo 'Generating translations for multi-language $(2)'
@$(HOST_PYTHON) ../Translations/make_translation.py \ @$(HOST_PYTHON) ../Translations/make_translation.py \
--macros $(PWD)/Core/Gen/macros.txt \ --macros $(CURDIR)/Core/Gen/macros.txt \
-o $(PWD)/Core/Gen/Translation_multi.$(1).cpp \ -o $(CURDIR)/Core/Gen/Translation_multi.$(1).cpp \
--output-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle \ --output-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle \
$(3) $(3)
@@ -829,8 +829,8 @@ Core/Gen/Translation_brieflz_multi.$(1).cpp: $(OUTPUT_DIR)/Core/Gen/translation.
@test -d $$(@D) || mkdir -p $$(@D) @test -d $$(@D) || mkdir -p $$(@D)
@echo Generating BriefLZ compressed translation for multi-language $(2) @echo Generating BriefLZ compressed translation for multi-language $(2)
@OBJCOPY=$(OBJCOPY) $(HOST_PYTHON) ../Translations/make_translation.py \ @OBJCOPY=$(OBJCOPY) $(HOST_PYTHON) ../Translations/make_translation.py \
--macros $(PWD)/Core/Gen/macros.txt \ --macros $(CURDIR)/Core/Gen/macros.txt \
-o $(PWD)/Core/Gen/Translation_brieflz_multi.$(1).cpp \ -o $(CURDIR)/Core/Gen/Translation_brieflz_multi.$(1).cpp \
--input-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle \ --input-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle \
--strings-obj $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).o \ --strings-obj $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).o \
--compress-font \ --compress-font \
@@ -873,9 +873,9 @@ style:
# * process STOP env variable # * process STOP env variable
check-style: check-style:
@error=0; export LIST=$$LIST; for src in $(ALL_SOURCE) $(ALL_INCLUDES) ; do \ @error=0; export LIST=$$LIST; for src in $(ALL_SOURCE) $(ALL_INCLUDES) ; do \
../scripts/deploy.sh check_style_file "$$src" ; \ ../scripts/deploy.sh check_style_file "$$src" ; \
test "$${?}" -eq 1 && export error=1 ; \ test "$${?}" -eq 1 && export error=1 ; \
test "$${error}" -eq 1 && test -n "$${STOP}" && break; \ test "$${error}" -eq 1 && test -n "$${STOP}" && break; \
done; \ done; \
if [ $$error -eq 0 ] ; then echo "" && echo "" && echo "Style check: PASS" && echo "" && echo "" && exit 0 ; \ if [ $$error -eq 0 ] ; then echo "" && echo "" && echo "Style check: PASS" && echo "" && echo "" && exit 0 ; \
else echo "" && echo "" && echo "Style check: FAIL! Please, check the log above for the details." && echo "If there is a false-negative trigger, please, report an issue attaching the log or link to the log!" && echo "" && echo "" && exit 1 ; \ else echo "" && echo "" && echo "Style check: FAIL! Please, check the log above for the details." && echo "If there is a false-negative trigger, please, report an issue attaching the log or link to the log!" && echo "" && echo "" && exit 1 ; \