Skip to content

Commit

Permalink
Merge pull request #86 from duhow/artifacts-and-armhf
Browse files Browse the repository at this point in the history
Build: Add OSX, Linux armhf and upload artifacts
  • Loading branch information
Alberto Gutiérrez Torre committed Feb 2, 2021
2 parents 0eb102d + 8634ff9 commit 09924ff
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 7 deletions.
56 changes: 53 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ jobs:
choco install winflexbison
- name: make
run: msbuild build/vs2019/asmsx.sln
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: asmsx-win-x86_64
path: build/vs2019/Debug/asmsx.exe

linux:
runs-on: ubuntu-latest
Expand All @@ -40,14 +45,59 @@ jobs:
sudo apt update
sudo apt install -y libbison-dev libfl-dev build-essential cmake flex bison libpthread-stubs0-dev libgtest-dev
- name: make
run: |
make
run: make
- name: prepare for test
run: |
cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make
sudo make install
- name: test
run: make test
- name: cleanup and build again
run: |
make clean
make
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: asmsx-linux-x86_64
path: asmsx

linux-armhf:
needs: linux
runs-on: ubuntu-latest
env:
GCC_VERSION: "10.2-2020.11"
BUILD_TARGET: arm-none-linux-gnueabihf
GCC_NAME: "gcc-arm-10.2-2020.11-x86_64-arm-none-linux-gnueabihf"
steps:
- uses: actions/checkout@v2
- name: install deps
run: |
make test
sudo apt update
sudo apt install -y libbison-dev libfl-dev build-essential cmake flex bison libpthread-stubs0-dev libgtest-dev
wget https://developer.arm.com/-/media/Files/downloads/gnu-a/${{ env.GCC_VERSION }}/binrel/${{ env.GCC_NAME }}.tar.xz
tar xvf ${{ env.GCC_NAME }}.tar.xz
- name: make
run: make CC=${{ env.GCC_NAME }}/bin/${{ env.BUILD_TARGET }}-gcc LDFLAGS="-static"
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: asmsx-${{ env.BUILD_TARGET }}
path: asmsx

osx:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- name: install deps
run: brew install flex bison
- name: make
run: make
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: asmsx-osx
path: asmsx

8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ CC_WIN = i686-w64-mingw32-gcc

# Default compiler
CC = $(CC_LIN)
OPT = -lm -O2 -Os -s -Wall -Wextra -DVERSION=\"$(VERSION)\" -DDATE=\"$(DATE)\"
OPT_DEBUG = -lm -Os -Wall -Wextra -DVERSION=\"$(VERSION)\" -DDATE=\"$(DATE)\"
OPT = -lm -Os -s -Wall -Wextra -DVERSION=\"$(VERSION)\" -DDATE=\"$(DATE)\"
OPT_DEBUG = -lm -Os -ggdb -Wall -Wextra -DVERSION=\"$(VERSION)\" -DDATE=\"$(DATE)\"

BUILD_FILES = src/dura.tab.c \
src/dura.tab.h \
Expand Down Expand Up @@ -75,10 +75,10 @@ src/%.o: src/%.c
asmsx.osx: CC := $(CC_OSX)
asmsx.exe: CC := $(CC_WIN)
asmsx asmsx.osx asmsx.exe: $(ALL_FILES) $(HEADERS)
$(CC) $(ALL_FILES) -o$@ $(OPT)
$(CC) $(ALL_FILES) -o$@ $(LDFLAGS) $(OPT)

asmsx-debug: $(ALL_FILES) $(HEADERS) src/dura.y src/lex.l
$(CC) -ggdb $(ALL_FILES) -o$@ $(OPT_DEBUG)
$(CC) $(ALL_FILES) -o$@ $(LDFLAGS) $(OPT_DEBUG)

release: asmsx asmsx.exe asmsx.osx
zip asmsx_$(VERSION)_linux64.zip asmsx
Expand Down

0 comments on commit 09924ff

Please sign in to comment.