-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from d99kris/github-actions-ci
migrate to github actions ci
- Loading branch information
Showing
11 changed files
with
149 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Linux | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
linux-build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Build Linux | ||
run: ./make.sh all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: macOS | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
mac-build: | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Build macOS | ||
run: ./make.sh all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#!/usr/bin/env bash | ||
|
||
# make.sh | ||
# | ||
# Copyright (C) 2020 Kristofer Berggren | ||
# All rights reserved. | ||
# | ||
# See LICENSE for redistribution information. | ||
|
||
# exiterr | ||
exiterr() | ||
{ | ||
>&2 echo "${1}" | ||
exit 1 | ||
} | ||
|
||
# process arguments | ||
DEPS="0" | ||
BUILD="0" | ||
TESTS="0" | ||
DOC="0" | ||
INSTALL="0" | ||
case "${1%/}" in | ||
deps) | ||
DEPS="1" | ||
;; | ||
|
||
build) | ||
BUILD="1" | ||
;; | ||
|
||
test*) | ||
BUILD="1" | ||
TESTS="1" | ||
;; | ||
|
||
doc) | ||
BUILD="1" | ||
DOC="1" | ||
;; | ||
|
||
install) | ||
BUILD="1" | ||
INSTALL="1" | ||
;; | ||
|
||
all) | ||
DEPS="1" | ||
BUILD="1" | ||
TESTS="1" | ||
DOC="1" | ||
INSTALL="1" | ||
;; | ||
|
||
*) | ||
echo "usage: make.sh <deps|build|tests|doc|install|all>" | ||
echo " deps - install project dependencies" | ||
echo " build - perform build" | ||
echo " tests - perform build and run tests" | ||
echo " doc - perform build and generate documentation" | ||
echo " install - perform build and install" | ||
echo " all - perform all actions above" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# deps | ||
if [[ "${DEPS}" == "1" ]]; then | ||
OS="$(uname)" | ||
if [ "${OS}" == "Linux" ]; then | ||
DISTRO="$(lsb_release -i | awk -F':\t' '{print $2}')" | ||
if [[ "${DISTRO}" == "Ubuntu" ]]; then | ||
pip3 install -U spacy && python3 -m spacy download en_core_web_sm || exiterr "deps failed (linux), exiting." | ||
else | ||
exiterr "deps failed (unsupported linux distro ${DISTRO}), exiting." | ||
fi | ||
elif [ "${OS}" == "Darwin" ]; then | ||
pip3 install -U spacy && python3 -m spacy download en_core_web_sm || exiterr "deps failed (mac), exiting." | ||
else | ||
exiterr "deps failed (unsupported os ${OS}), exiting." | ||
fi | ||
fi | ||
|
||
# build | ||
if [[ "${BUILD}" == "1" ]]; then | ||
mkdir -p build && cd build && cmake .. && make && cd .. || exiterr "build failed, exiting." | ||
fi | ||
|
||
# tests | ||
if [[ "${TESTS}" == "1" ]]; then | ||
cd build && ctest --output-on-failure && cd .. || exiterr "tests failed, exiting." | ||
fi | ||
|
||
# doc | ||
if [[ "${DOC}" == "1" ]]; then | ||
true || exiterr "doc failed, exiting." | ||
fi | ||
|
||
# install | ||
if [[ "${INSTALL}" == "1" ]]; then | ||
OS="$(uname)" | ||
if [ "${OS}" == "Linux" ]; then | ||
cd build && sudo make install && cd .. || exiterr "install failed (linux), exiting." | ||
elif [ "${OS}" == "Darwin" ]; then | ||
cd build && make install && cd .. || exiterr "install failed (mac), exiting." | ||
else | ||
exiterr "install failed (unsupported os ${OS}), exiting." | ||
fi | ||
fi | ||
|
||
# exit | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters