Skip to content

Commit

Permalink
github compile fix aftermath (#187)
Browse files Browse the repository at this point in the history
* Revert "thrust lionearization"

This reverts commit 627ad35.

* try to fix the recent regression

* adopt Makefile so it should work for both travis and github actions; enhanced semantics for the github actions build; fixed artifacts not getting stored on pull requests
  • Loading branch information
gretel authored Apr 21, 2020
1 parent 0fae1a1 commit 922a956
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 27 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@ jobs:
with:
fetch-depth: 0

- name: Version String
id: get_version
run: echo "::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}"
- name: Get build number
id: get_buildno
run: echo ::set-env name=BUILD_NUMBER::${{ github.run_number }}

- name: Setup Python
uses: actions/setup-python@v1
- name: Get pull request number
id: get_pullno
run: echo ::set-env name=PULL_NUMBER::$(echo "$GITHUB_REF" | awk -F / '{print $3}')
if: startsWith(github.ref, 'refs/pull/')

- name: Setup Toolchain
uses: fiam/arm-none-eabi-gcc@v1
with:
release: '9-2019-q4' # The arm-none-eabi-gcc release to use.
- name: Get revision tag
id: get_revtag
run: echo "::set-output name=REVISION_TAG::${GITHUB_REF/refs\/tags\//}"
if: startsWith(github.ref, 'refs/tags/')

- name: Take the trash out
run: |
Expand All @@ -41,21 +43,34 @@ jobs:
sync
df -h
- name: Setup Python
uses: actions/setup-python@v1

- name: Setup Toolchain
uses: fiam/arm-none-eabi-gcc@v1
with:
release: '9-2019-q4' # The arm-none-eabi-gcc release to use.

- name: Get code version
id: get_version
run: echo "::set-output name=VERSION::$(make version)"

- name: Compile Code
run: |
make all
- name: Store Artifacts
uses: actions/upload-artifact@v2-preview
with:
name: EmuFlight-${{ steps.get_version.outputs.VERSION }}-${{ github.run_number }}
name: EmuFlight-${{ steps.get_version.outputs.VERSION }}-${{ steps.get_buildno.outputs.BUILD_NUMBER }}
path: obj/*.hex
continue-on-error: true

- name: Release Binaries
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: EmuFlight-${{ steps.get_version.outputs.VERSION }}
prerelease: true
draft: true
files: obj/*.hex
Expand Down
28 changes: 11 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,16 @@ FEATURES =

include $(ROOT)/make/targets.mk

# if building on travis the branch name is set
ifneq ($(TRAVIS_BRANCH),)
# so use it
BRANCH := $(TRAVIS_BRANCH)
else
# otherwise, call git
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
endif
# build number - default for local builds
BUILDNO := local

BRANCH := $(shell echo $(BRANCH))
# github actions build
ifneq ($(BUILD_NUMBER),)
BUILDNO := $(BUILD_NUMBER)
endif

# building locally build number does not increment
BUILDNO := local
# if building on travis we have a build number set
# travis build
ifneq ($(TRAVIS_BUILD_NUMBER),)
# so use it
BUILDNO := $(TRAVIS_BUILD_NUMBER)
endif

Expand All @@ -128,7 +122,7 @@ FATFS_SRC = $(notdir $(wildcard $(FATFS_DIR)/*.c))

CSOURCES := $(shell find $(SRC_DIR) -name '*.c')

LD_FLAGS :=
LD_FLAGS :=

#
# Default Tool options - can be overridden in {mcu}.mk files.
Expand All @@ -137,10 +131,10 @@ ifeq ($(DEBUG),GDB)
OPTIMISE_DEFAULT := -Og

LTO_FLAGS := $(OPTIMISE_DEFAULT)
DEBUG_FLAGS = -ggdb3 -DDEBUG
DEBUG_FLAGS = -ggdb3 -DDEBUG
else
ifeq ($(DEBUG),INFO)
DEBUG_FLAGS = -ggdb3
DEBUG_FLAGS = -ggdb3
endif
OPTIMISATION_BASE := -flto -fuse-linker-plugin -ffast-math
OPTIMISE_DEFAULT := -O2
Expand Down Expand Up @@ -370,7 +364,7 @@ all_with_unsupported: $(VALID_TARGETS)
## unsupported : Build unsupported targets
unsupported: $(UNSUPPORTED_TARGETS)

## official : Build all official (travis) targets
## official : Build all "official" targets
official: $(OFFICIAL_TARGETS)

## targets-group-1 : build some targets
Expand Down

0 comments on commit 922a956

Please sign in to comment.