Add CI scripts

The previous script was removed. Status badges were added to the readme file. The master branch was separated into a workflow of it's own. Both scripts were enhanced to support cross platform builds on windows, linux, and macos.
This commit is contained in:
Shane Gramlich 2019-12-16 21:20:08 -07:00
parent 374b4fa07a
commit a1af7928ba
4 changed files with 220 additions and 48 deletions

View File

@ -1,48 +0,0 @@
name: Build GitAhead (Mac)
on: [push]
jobs:
build:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- name: Initialize Submodules
uses: snickerbockers/submodules-init@v4
- name: Build OpensSSL
run: |
cd dep/openssl/openssl
./Configure darwin64-x86_64-cc no-shared
make
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@v1
with:
version: 1.9.0
platform: mac # [win, mac, linux]
destination: ninja
- name: Install Qt
uses: jurplel/install-qt-action@v2.2.0
with:
version: 5.12.5
target: desktop
host: mac
install-deps: true
modules: qtwebengine
- name: Configure Release
run: |
mkdir -p build/release
cd build/release
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ../..
- name: Build Information
run: |
echo "ninja version: $(ninja --version)"
git --version
qmake --version
cmake --version
- name: Build
run: |
cd build/release
ninja
- name: Test
run: |
cd build/release
echo "TODO: Disable ui tests in headless environment or find a way to send tests to an external browser, ninja check"
#ninja check

108
.github/workflows/build-master.yml vendored Normal file
View File

@ -0,0 +1,108 @@
# Production CI Script
#
# Triggers a full build of GitAhead when a new commit is pushed to master.
# The build status badge can be accessed at:
# https://github.com/gitahead/gitahead/workflows/GitAhead%20%28master%29/badge.svg
---
name: GitAhead (master)
on:
push:
branches:
- master
jobs:
build:
runs-on: ${{ matrix.env.os }}
strategy:
fail-fast: false
matrix:
env:
- name: linux
os: ubuntu-latest
ninja_platform: linux
qt_platform: linux
arch: linux-x86_64
cmake_env: {}
- name: mac
os: macos-latest
ninja_platform: mac
qt_platform: mac
arch: darwin64-x86_64-cc
cmake_env: {}
- name: win
os: windows-latest
ninja_platform: win
qt_platform: windows
arch: VC-WIN64A
cmake_env:
CC: cl
CXX: cl
steps:
- uses: actions/checkout@v1
- name: Initialize Submodules
uses: snickerbockers/submodules-init@v4
- name: Install Perl
if: matrix.env.name == 'win'
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.30'
- name: Install Nmake
if: matrix.env.name == 'win'
uses: seanmiddleditch/gha-setup-vsdevenv@v1
- name: Install NASM
if: matrix.env.name == 'win'
uses: ilammy/setup-nasm@v1.0.0
- name: Build OpenSSL (linux)
if: matrix.env.name == 'linux'
run: |
cd dep/openssl/openssl
./config -fPIC
make
- name: Build OpenSSL (mac)
if: matrix.env.name == 'mac'
run: |
cd dep/openssl/openssl
./Configure ${{ matrix.env.arch }} no-shared
make
- name: Build OpensSSL (win)
if: matrix.env.name == 'win'
run: |
cd dep/openssl/openssl
perl Configure VC-WIN64A
nmake
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@v1
with:
version: 1.9.0
platform: ${{ matrix.env.ninja_platform }}
destination: ninja
- name: Install Qt
uses: jurplel/install-qt-action@v2.2.0
timeout-minutes: 10
with:
version: 5.12.5
target: desktop
host: ${{ matrix.env.qtplatform }}
install-deps: true
modules: qtwebengine
- name: Configure Release
env: ${{ matrix.env.cmake_env }}
run: |
mkdir -p build/release
cd build/release
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ../..
- name: Build Information
run: |
echo "ninja version: $(ninja --version)"
git --version
qmake --version
cmake --version
- name: Build
run: |
cd build/release
ninja
- name: Test
continue-on-error: true
run: |
cd build/release
ninja check
...

109
.github/workflows/build-stage.yml vendored Normal file
View File

@ -0,0 +1,109 @@
# Development CI Script
#
# This script kicks off a build for every event exculding commits pushed to the
# master branch. This includes pull requests and page builds to any branch.
---
name: GitAhead (stage)
on:
push:
branches-ignore:
- master
pull_request:
page_build:
jobs:
build:
runs-on: ${{ matrix.env.os }}
strategy:
fail-fast: false
matrix:
env:
- name: linux
os: ubuntu-latest
ninja_platform: linux
qt_platform: linux
arch: linux-x86_64
cmake_env: {}
- name: mac
os: macos-latest
ninja_platform: mac
qt_platform: mac
arch: darwin64-x86_64-cc
cmake_env: {}
- name: win
os: windows-latest
ninja_platform: win
qt_platform: windows
arch: VC-WIN64A
cmake_env:
CC: cl
CXX: cl
steps:
- uses: actions/checkout@v1
- name: Initialize Submodules
uses: snickerbockers/submodules-init@v4
- name: Install Perl
if: matrix.env.name == 'win'
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.30'
- name: Install Nmake
if: matrix.env.name == 'win'
uses: seanmiddleditch/gha-setup-vsdevenv@v1
- name: Install NASM
if: matrix.env.name == 'win'
uses: ilammy/setup-nasm@v1.0.0
- name: Build OpenSSL (linux)
if: matrix.env.name == 'linux'
run: |
cd dep/openssl/openssl
./config -fPIC
make
- name: Build OpenSSL (mac)
if: matrix.env.name == 'mac'
run: |
cd dep/openssl/openssl
./Configure ${{ matrix.env.arch }} no-shared
make
- name: Build OpensSSL (win)
if: matrix.env.name == 'win'
run: |
cd dep/openssl/openssl
perl Configure VC-WIN64A
nmake
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@v1
with:
version: 1.9.0
platform: ${{ matrix.env.ninja_platform }}
destination: ninja
- name: Install Qt
uses: jurplel/install-qt-action@v2.2.0
timeout-minutes: 10
with:
version: 5.12.5
target: desktop
host: ${{ matrix.env.qtplatform }}
install-deps: true
modules: qtwebengine
- name: Configure Release
env: ${{ matrix.env.cmake_env }}
run: |
mkdir -p build/release
cd build/release
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ../..
- name: Build Information
run: |
echo "ninja version: $(ninja --version)"
git --version
qmake --version
cmake --version
- name: Build
run: |
cd build/release
ninja
- name: Test
continue-on-error: true
run: |
cd build/release
ninja check
...

View File

@ -1,3 +1,6 @@
[![Actions Status](https://github.com/gitahead/gitahead/workflows/GitAhead%20%28master%29/badge.svg)](https://github.com/gitahead/gitahead/actions) [![Actions Status](https://github.com/gitahead/gitahead/workflows/GitAhead%20%28stage%29/badge.svg)](https://github.com/gitahead/gitahead/actions)
GitAhead - Understand Your History
==================================