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

Build: Add OSX, Linux armhf and upload artifacts #86

Merged
merged 5 commits into from
Feb 2, 2021
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
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