Skip to content

Commit

Permalink
testing update of GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
cboulay committed Mar 7, 2020
1 parent 9fe4173 commit b676f48
Showing 1 changed file with 94 additions and 17 deletions.
111 changes: 94 additions & 17 deletions .github/workflows/cppcmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ name: C/C++ CI

on:
push:
branches:
- master
tags:
- v*.*
pull_request:
branches:
- master

env:
LSL_URL: 'https://github.com/sccn/liblsl/releases/download'
LSL_RELEASE: '1.13.0'
LSL_RELEASE_SUFFIX: ''
LSL_RELEASE_PREFIX: 'v'
LSL_RELEASE: '1.14.0'
LSL_RELEASE_SUFFIX: 'b1'


jobs:
Expand All @@ -24,44 +25,120 @@ jobs:
- windows-latest
- macOS-latest
fail-fast: false

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: CMake version
run: cmake --version

- name: download liblsl (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
curl -L ${LSL_URL}/${LSL_RELEASE}${LSL_RELEASE_SUFFIX}/liblsl-${LSL_RELEASE}-Linux64-bionic.deb -o liblsl.deb
echo ${{ github.ref }}
curl -L ${LSL_URL}/${LSL_RELEASE_PREFIX}${LSL_RELEASE}${LSL_RELEASE_SUFFIX}/liblsl-${LSL_RELEASE}-Linux64-bionic.deb -o liblsl.deb
sudo dpkg -i liblsl.deb
sudo apt install -y qtbase5-dev
if: matrix.os == 'ubuntu-latest'
sudo apt install -y qtbase5-dev qtmultimedia5-dev
- name: download liblsl (Windows)
if: matrix.os == 'windows-latest'
run: |
Invoke-WebRequest -Uri $Env:LSL_URL/$Env:LSL_RELEASE$Env:LSL_RELEASE_SUFFIX/liblsl-$Env:LSL_RELEASE-Win64.zip -o liblsl.7z
Invoke-WebRequest -Uri $Env:LSL_URL/$Env:LSL_RELEASE_PREFIX$Env:LSL_RELEASE$Env:LSL_RELEASE_SUFFIX/liblsl-$Env:LSL_RELEASE-Win64.zip -o liblsl.7z
7z x liblsl.7z -oLSL
if: matrix.os == 'windows-latest'
- name: download liblsl (macOS)
if: matrix.os == 'macOS-latest'
run: |
curl -L ${LSL_URL}/${LSL_RELEASE}${LSL_RELEASE_SUFFIX}/liblsl-${LSL_RELEASE}-OSX64.tar.bz2 -o liblsl.tar.bz2
curl -L ${LSL_URL}/${LSL_RELEASE_PREFIX}${LSL_RELEASE}${LSL_RELEASE_SUFFIX}/liblsl-${LSL_RELEASE}-OSX64.tar.bz2 -o liblsl.tar.bz2
mkdir LSL
tar -xvf liblsl.tar.bz2 -C LSL
brew install qt
echo '::set-env name=CMAKE_PREFIX_PATH::/usr/local/opt/qt'
if: matrix.os == 'macOS-latest'
# TODO: Need to fix liblsl CI
- name: Install Qt
if: matrix.os == 'windows-latest'
# uses: jurplel/install-qt-action@v2
uses: ouuan/install-qt-action@v2.3.1 # workaround until the aqtinstall timeout is fixed
with:
version: 5.14.0
if: matrix.os == 'windows-latest'

- name: Configure CMake
shell: bash
run: |
cmake -S . -B build -DLSL_INSTALL_ROOT=$PWD/LSL/ -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON -DCPACK_DEBIAN_PACKAGE_DEPENDS=1
- name: make
- name: Make
run: cmake --build build --config Release -j
- name: package

- name: Install
run: cmake --build build --config Release -j --target install
- uses: actions/upload-artifact@master

- name: Package
run: cmake --build build --config Release -j --target package

# TODO: upload-artifact@v2 (in-progress) will support file glob
- name: Upload Artifacts (ubuntu)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@master
with:
name: pkg-${{ matrix.os }}
path: build/AppTemplate_cpp_qt-1.13.0-Linux64-bionic.deb

- name: Upload Artifacts (macOS)
if: matrix.os == 'macOS-latest'
uses: actions/upload-artifact@master
with:
name: pkg-${{ matrix.os }}
path: build/AppTemplate_cpp_qt-1.13.0-OSX64.tar.bz2

# TODO: Can reconstruct filename from project name and version in CMakeCache.txt using powershell:
# Select-String -Path build\CMakeCache.txt -Pattern "CMAKE_PROJECT_NAME:STATIC=(.*)" | % { $_.matches.groups[1] } | % {$_.Value}
# Select-String -Path build\CMakeCache.txt -Pattern "CMAKE_PROJECT_VERSION:STATIC=(.*)" | % { $_.matches.groups[1] } | % {$_.Value}
- name: Upload Artifacts (windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@master
with:
name: pkg-${{ matrix.os }}
path: build/install
path: build/AppTemplate_cpp_qt-1.13.0-Win64.zip

release:
needs: build
runs-on: ubuntu-latest
steps:

# TODO: download-artifact@v2 will support multiple download
- name: Download Artifact (ubuntu)
if: startsWith(github.ref, 'refs/tags/')
uses: actions/download-artifact@v1
with:
name: pkg-ubuntu-latest

- name: Download Artifact (windows)
if: startsWith(github.ref, 'refs/tags/')
uses: actions/download-artifact@v1
with:
name: pkg-windows-latest

- name: Download Artifact (macOS)
if: startsWith(github.ref, 'refs/tags/')
uses: actions/download-artifact@v1
with:
name: pkg-macOS-latest

- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# tag_name: ${{ github.ref }} # ${{ github.ref }} is default
name: Release ${{ github.ref }}
draft: false
prerelease: false
# body_path: CHANGELOG.txt
files: |
pkg-ubuntu-latest/AppTemplate_cpp_qt-1.13.0-Linux64-bionic.deb
pkg-macOS-latest/AppTemplate_cpp_qt-1.13.0-OSX64.tar.bz2
pkg-windows-latest/AppTemplate_cpp_qt-1.13.0-Win64.zip

0 comments on commit b676f48

Please sign in to comment.