added GitHub Actions as CI/CD service

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
Paulchen-Panther 2019-09-12 19:47:23 +02:00
parent 145f88d5af
commit 3173c9f7e3
4 changed files with 92 additions and 1 deletions

View File

@ -9,6 +9,10 @@ elif [ "$SYSTEM_COLLECTIONID" != "" ]; then
# Azure Pipelines
CI_NAME="$(echo "$AGENT_OS" | tr '[:upper:]' '[:lower:]')"
CI_BUILD_DIR="$BUILD_SOURCESDIRECTORY"
elif [ "$HOME" != "" ]; then
# GitHub Actions
CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
CI_BUILD_DIR="$GITHUB_WORKSPACE"
else
# for executing in non ci environment
CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
@ -18,7 +22,7 @@ fi
[ -z "${BUILD_TYPE}" ] && BUILD_TYPE="Debug"
# Determine cmake build type; tag builds are Release, else Debug (-dev appends to platform)
if [[ $BUILD_SOURCEBRANCH == *"refs/tags"* ]]; then
if [[ $BUILD_SOURCEBRANCH == *"refs/tags"* || $GITHUB_REF == *"refs/tags"* ]]; then
BUILD_TYPE=Release
else
PLATFORM=${PLATFORM}-dev

View File

@ -4,9 +4,15 @@
if [ -n "${TRAVIS-}" ]; then
# Travis-CI
CI_NAME="$(echo "$TRAVIS_OS_NAME" | tr '[:upper:]' '[:lower:]')"
CI_BUILD_DIR="$TRAVIS_BUILD_DIR"
elif [ "$SYSTEM_COLLECTIONID" != "" ]; then
# Azure Pipelines
CI_NAME="$(echo "$AGENT_OS" | tr '[:upper:]' '[:lower:]')"
CI_BUILD_DIR="$BUILD_SOURCESDIRECTORY"
elif [ "$HOME" != "" ]; then
# GitHub Actions
CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
CI_BUILD_DIR="$GITHUB_WORKSPACE"
else
# for executing in non ci environment
CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"

80
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,80 @@
name: GitHub Actions
on: [push, pull_request]
jobs:
Linux:
name: ${{ matrix.dockerName }}
runs-on: ubuntu-latest
strategy:
matrix:
dockerTag: [ amd64, i386, armv6hf, armv7hf, aarch64 ]
include:
- dockerTag: amd64
dockerName: Debian Stretch (AMD64)
platform: x11
- dockerTag: i386
dockerName: Debian Stretch (i386)
platform: x11
- dockerTag: armv6hf
dockerName: Debian Stretch (Raspberry Pi v1 & ZERO)
platform: rpi
- dockerTag: armv7hf
dockerName: Debian Stretch (Raspberry Pi 2 & 3)
platform: rpi
- dockerTag: aarch64
dockerName: Debian Stretch (Generic AARCH64)
platform: amlogic
steps:
- uses: actions/checkout@v1
with:
submodules: true
# build process
- name: Build packages
env:
DOCKER_TAG: ${{ matrix.dockerTag }}
DOCKER_NAME: ${{ matrix.dockerName }}
PLATFORM: ${{ matrix.platform }}
shell: bash
run: ./.ci/ci_build.sh
# create/update github release (replacement for Microsoft Azure after the beta phase)
# - name: Create/Update GitHub release
# if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
# uses: docker://softprops/action-gh-release
# with:
# files: deploy/Hyperion.NG-*
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
macOS:
name: macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
# install dependencies
- name: Install dependencies
shell: bash
run: ./.ci/ci_install.sh
# build process
- name: Build packages
env:
PLATFORM: osx
shell: bash
run: ./.ci/ci_build.sh
# create/update github release (replacement for Microsoft Azure after the beta phase)
# - name: Create/Update GitHub release
# if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
# uses: docker://softprops/action-gh-release
# with:
# files: deploy/Hyperion.NG-*
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -3,6 +3,7 @@
[![Dependencies](https://img.shields.io/librariesio/github/hyperion-project/hyperion.ng.svg)](https://github.com/hyperion-project/hyperion.ng/tree/master/dependencies/external)
[![Azure-Pipeline](https://dev.azure.com/Hyperion-Project/Hyperion.NG/_apis/build/status/Hyperion.NG?branchName=master)](https://dev.azure.com/Hyperion-Project/Hyperion.NG/_build/latest?definitionId=7&branchName=master)
[![Travis-CI](https://travis-ci.org/hyperion-project/hyperion.ng.svg?branch=master)](https://travis-ci.org/hyperion-project/hyperion.ng)
[![GitHub Actions](https://github.com/hyperion-project/hyperion.ng/workflows/GitHub%20Actions/badge.svg)](https://github.com/hyperion-project/hyperion.ng/actions)
[![LGTM](https://img.shields.io/lgtm/alerts/g/hyperion-project/hyperion.ng.svg)](https://lgtm.com/projects/g/hyperion-project/hyperion.ng/alerts/)
[![Documentation](https://codedocs.xyz/hyperion-project/hyperion.ng.svg)](https://codedocs.xyz/hyperion-project/hyperion.ng/)