Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify commands for jobs in push.yml #1761

Merged
merged 7 commits into from
Jul 28, 2023
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
25 changes: 8 additions & 17 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ jobs:
run: cd source && ./build.sh -m ${{ matrix.model }}

- name: Copy license files
run: |
cp LICENSE source/Hexfile/LICENSE
cp scripts/LICENSE_RELEASE.md source/Hexfile/LICENSE_RELEASE.md
run: cp LICENSE scripts/LICENSE_RELEASE.md source/Hexfile/

- name: Archive ${{ matrix.model }} artifacts
uses: actions/upload-artifact@v3
Expand All @@ -47,7 +45,7 @@ jobs:
if-no-files-found: error

- 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
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -79,12 +77,10 @@ jobs:
run: git config --global --add safe.directory /__w/IronOS/IronOS && git config --global safe.directory "$GITHUB_WORKSPACE"

- 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
run: |
cp LICENSE source/Hexfile/LICENSE
cp scripts/LICENSE_RELEASE.md source/Hexfile/LICENSE_RELEASE.md
run: cp LICENSE scripts/LICENSE_RELEASE.md source/Hexfile/

- name: Archive ${{ matrix.model }} artifacts
uses: actions/upload-artifact@v3
Expand All @@ -99,7 +95,7 @@ jobs:
if-no-files-found: error

- 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
uses: actions/upload-artifact@v3
Expand All @@ -125,15 +121,10 @@ jobs:
run: python3 -m pip install bdflib

- 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
run: |
cd source
make Objects/host/brieflz/libbrieflz.so
cd ../Translations
chmod +x brieflz_test.py
./brieflz_test.py
run: make -C source/ Objects/host/brieflz/libbrieflz.so && ./Translations/brieflz_test.py


check_c-cpp:
Expand All @@ -150,7 +141,7 @@ jobs:
submodules: true

- name: Check format style with clang-format
run: cd source && make clean && make check-style
run: make clean check-style


check_python:
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ test-py:
@echo ""
flake8 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/make_translation_test.py

Expand All @@ -149,7 +149,7 @@ test-ccpp:
@echo ""
@echo "---- Checking C/C++ code... ----"
@echo ""
make -C source/ clean check-style
$(MAKE) -C source/ clean check-style

# meta target for tests & checks based on .github/workflows/push
tests: test-md test-sh test-py test-ccpp
Expand All @@ -159,11 +159,11 @@ tests: test-md test-sh test-py test-ccpp

# pass-through target for Makefile inside source/ dir
%:
make -C source/ $@
$(MAKE) -C source/ $@

# global clean-up target for produced/generated files inside tree
clean-build:
make -C source/ clean-all
$(MAKE) -C source/ clean-all
rm -Rf site
rm -Rf scripts/ci/artefacts

Expand Down
20 changes: 10 additions & 10 deletions source/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -763,15 +763,15 @@ Core/Gen/Translation_brieflz.%.cpp: $(OUTPUT_DIR)/Core/Gen/translation.files/%.o
@test -d $(@D) || mkdir -p $(@D)
@echo Generating BriefLZ compressed translation for $*
@OBJCOPY=$(OBJCOPY) $(HOST_PYTHON) ../Translations/make_translation.py \
--macros $(PWD)/Core/Gen/macros.txt \
-o $(PWD)/Core/Gen/Translation_brieflz.$*.cpp \
--macros $(CURDIR)/Core/Gen/macros.txt \
-o $(CURDIR)/Core/Gen/Translation_brieflz.$*.cpp \
--input-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/$*.pickle \
--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
@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 \
--macros $(PWD)/Core/Gen/macros.txt \
-o $(PWD)/Core/Gen/Translation_brieflz_font.$*.cpp \
Expand Down Expand Up @@ -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
@echo 'Generating translations for multi-language $(2)'
@$(HOST_PYTHON) ../Translations/make_translation.py \
--macros $(PWD)/Core/Gen/macros.txt \
-o $(PWD)/Core/Gen/Translation_multi.$(1).cpp \
--macros $(CURDIR)/Core/Gen/macros.txt \
-o $(CURDIR)/Core/Gen/Translation_multi.$(1).cpp \
--output-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle \
$(3)

Expand All @@ -829,8 +829,8 @@ Core/Gen/Translation_brieflz_multi.$(1).cpp: $(OUTPUT_DIR)/Core/Gen/translation.
@test -d $$(@D) || mkdir -p $$(@D)
@echo Generating BriefLZ compressed translation for multi-language $(2)
@OBJCOPY=$(OBJCOPY) $(HOST_PYTHON) ../Translations/make_translation.py \
--macros $(PWD)/Core/Gen/macros.txt \
-o $(PWD)/Core/Gen/Translation_brieflz_multi.$(1).cpp \
--macros $(CURDIR)/Core/Gen/macros.txt \
-o $(CURDIR)/Core/Gen/Translation_brieflz_multi.$(1).cpp \
--input-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle \
--strings-obj $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).o \
--compress-font \
Expand Down Expand Up @@ -873,9 +873,9 @@ style:
# * process STOP env variable
check-style:
@error=0; export LIST=$$LIST; for src in $(ALL_SOURCE) $(ALL_INCLUDES) ; do \
../scripts/deploy.sh check_style_file "$$src" ; \
test "$${?}" -eq 1 && export error=1 ; \
test "$${error}" -eq 1 && test -n "$${STOP}" && break; \
../scripts/deploy.sh check_style_file "$$src" ; \
test "$${?}" -eq 1 && export error=1 ; \
test "$${error}" -eq 1 && test -n "$${STOP}" && break; \
done; \
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 ; \
Expand Down