Skip to content

Commit

Permalink
Github Actions - Link Artifacts in PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdCopter committed Feb 21, 2024
1 parent 3fe7bd0 commit 1bdcf9d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 63 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
targets: [targets-group-1, targets-group-2, targets-group-3, targets-group-4, targets-group-5, targets-group-6, targets-group-7, targets-group-rest]
targets: [targets-group-1, targets-group-2, targets-group-3, targets-group-rest]
outputs:
buildtag: ${{ steps.ids.outputs.buildtag }}
shortsha: ${{ steps.ids.outputs.shortsha }}
Expand Down Expand Up @@ -59,9 +59,7 @@ jobs:
continue-on-error: true

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '2.7'
uses: actions/setup-python@v2

# EmuFlight version
- name: Get code version
Expand Down
24 changes: 1 addition & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -383,19 +383,7 @@ targets-group-2: $(GROUP_2_TARGETS)
## targets-group-3 : build some targets
targets-group-3: $(GROUP_3_TARGETS)

## targets-group-4 : build some targets
targets-group-4: $(GROUP_4_TARGETS)

## targets-group-5 : build some targets
targets-group-5: $(GROUP_5_TARGETS)

## targets-group-6 : build some targets
targets-group-6: $(GROUP_6_TARGETS)

## targets-group-7 : build some targets
targets-group-7: $(GROUP_7_TARGETS)

## targets-group-rest: build the rest of the targets (not listed in group 1, 2, 3...)
## targets-group-rest: build the rest of the targets (not listed in group 1, 2 or 3)
targets-group-rest: $(GROUP_OTHER_TARGETS)

$(VALID_TARGETS):
Expand Down Expand Up @@ -508,20 +496,10 @@ targets:
@echo "Base target: $(BASE_TARGET)"
@echo "targets-group-1: $(GROUP_1_TARGETS)"
@echo "targets-group-2: $(GROUP_2_TARGETS)"
@echo "targets-group-3: $(GROUP_3_TARGETS)"
@echo "targets-group-4: $(GROUP_4_TARGETS)"
@echo "targets-group-5: $(GROUP_5_TARGETS)"
@echo "targets-group-6: $(GROUP_6_TARGETS)"
@echo "targets-group-7: $(GROUP_7_TARGETS)"
@echo "targets-group-rest: $(GROUP_OTHER_TARGETS)"

@echo "targets-group-1: $(words $(GROUP_1_TARGETS)) targets"
@echo "targets-group-2: $(words $(GROUP_2_TARGETS)) targets"
@echo "targets-group-3: $(words $(GROUP_3_TARGETS)) targets"
@echo "targets-group-4: $(words $(GROUP_4_TARGETS)) targets"
@echo "targets-group-5: $(words $(GROUP_5_TARGETS)) targets"
@echo "targets-group-6: $(words $(GROUP_6_TARGETS)) targets"
@echo "targets-group-7: $(words $(GROUP_7_TARGETS)) targets"
@echo "targets-group-rest: $(words $(GROUP_OTHER_TARGETS)) targets"
@echo "total in all groups $(words $(SUPPORTED_TARGETS)) targets"

Expand Down
42 changes: 23 additions & 19 deletions make/linux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,30 @@
# and the ARM toolchain installed to either the Taulabs/tools directory, their
# respective default installation locations, or made available on the system path.

# First look for `python3`. If `which` doesn't return a null value, then it exists!
ifneq ($(shell which python3), "")
PYTHON:=python3
# Check for and find Python 2

# Get Python version, separate major/minor/patch, then put into wordlist
PYTHON_VERSION_=$(wordlist 2,4,$(subst ., ,$(shell python -V 2>&1)))
# Get major version from aforementioned list
PYTHON_MAJOR_VERSION_=$(word 1,$(PYTHON_VERSION_))
# Just in case Make has some weird scope stuff
PYTHON=0
# If the major Python version is the one we want..
ifeq ($(PYTHON_MAJOR_VERSION_),2)
# Then we can just use the normal Python executable
PYTHON:=python
else
# Get Python version, separate major/minor/patch, then put into wordlist
PYTHON_VERSION_=$(wordlist 2,4,$(subst ., ,$(shell python -V 2>&1)))
# Get major version from aforementioned list
PYTHON_MAJOR_VERSION_=$(word 1,$(PYTHON_VERSION_))
# Just in case Make has some weird scope stuff
PYTHON=0
# If the major Python version is the one we want..
ifeq ($(PYTHON_MAJOR_VERSION_),3)
# Then we can just use the normal Python executable
PYTHON:=python
else
# And if it doesn't exist, let's use the default Python, and warn the user.
# PYTHON NOT FOUND.
PYTHON:=python
echo "Python not found."
endif
# However, this isn't always the case..
# Let's look for `python2`. If `which` doesn't return a null value, then
# it exists!
ifneq ($(shell which python2), "")
PYTHON:=python2
else
# And if it doesn't exist, let's use the default Python, and warn the user.
# PYTHON NOT FOUND.
PYTHON:=python
echo "Python not found."
endif
endif

export PYTHON
18 changes: 1 addition & 17 deletions make/targets.mk
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ UNSUPPORTED_TARGETS := \
SUPPORTED_TARGETS := $(filter-out $(UNSUPPORTED_TARGETS), $(VALID_TARGETS))

TARGETS_TOTAL := $(words $(SUPPORTED_TARGETS))
TARGET_GROUPS := 8
TARGET_GROUPS := 4
TARGETS_PER_GROUP := $(shell expr $(TARGETS_TOTAL) / $(TARGET_GROUPS) )

ST := 1
Expand All @@ -99,22 +99,6 @@ ST := $(shell expr $(ET) + 1)
ET := $(shell expr $(ST) + $(TARGETS_PER_GROUP))
GROUP_3_TARGETS := $(wordlist $(ST), $(ET), $(SUPPORTED_TARGETS))

ST := $(shell expr $(ET) + 1)
ET := $(shell expr $(ST) + $(TARGETS_PER_GROUP))
GROUP_4_TARGETS := $(wordlist $(ST), $(ET), $(SUPPORTED_TARGETS))

ST := $(shell expr $(ET) + 1)
ET := $(shell expr $(ST) + $(TARGETS_PER_GROUP))
GROUP_5_TARGETS := $(wordlist $(ST), $(ET), $(SUPPORTED_TARGETS))

ST := $(shell expr $(ET) + 1)
ET := $(shell expr $(ST) + $(TARGETS_PER_GROUP))
GROUP_6_TARGETS := $(wordlist $(ST), $(ET), $(SUPPORTED_TARGETS))

ST := $(shell expr $(ET) + 1)
ET := $(shell expr $(ST) + $(TARGETS_PER_GROUP))
GROUP_7_TARGETS := $(wordlist $(ST), $(ET), $(SUPPORTED_TARGETS))

GROUP_OTHER_TARGETS := $(filter-out $(GROUP_1_TARGETS) $(GROUP_2_TARGETS) $(GROUP_3_TARGETS), $(SUPPORTED_TARGETS))

ifeq ($(filter $(TARGET),$(ALT_TARGETS)), $(TARGET))
Expand Down

0 comments on commit 1bdcf9d

Please sign in to comment.