Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
Create gha.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ygj6 committed Apr 13, 2020
1 parent 67ecfc4 commit 79b6c60
Show file tree
Hide file tree
Showing 2 changed files with 216 additions and 0 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/gha.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: CI

on:
pull_request:
types: [opened, synchronize]
paths-ignore:
- '**.md'
- '.mailmap'
- 'ChangeLog*'
- 'whatsnew*'
- 'LICENSE'
push:
paths-ignore:
- '**.md'
- '.mailmap'
- 'ChangeLog*'
- 'whatsnew*'
- 'LICENSE'

jobs:
linux-cmake:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04]
EVHTP_MATRIX:
- Debug

steps:
- uses: actions/[email protected]
- name: Cache Build
uses: actions/[email protected]
with:
path: build
key: ${{ matrix.os }}-cmake-${{ matrix.EVHTP_MATRIX }}

- name: Install Dependes
run: |
sudo apt install libevent-dev libonig-dev
- name: Build And Test
shell: bash
run: |
if [ "${{ matrix.EVHTP_MATRIX }}" == "Debug" ]; then
EVHTP_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Debug"
fi
mkdir -p build
cd build
echo [cmake]: cmake .. $EVHTP_CMAKE_OPTIONS
cmake .. $EVHTP_CMAKE_OPTIONS
cmake --build .
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.os }}-cmake-${{ matrix.EVHTP_MATRIX }}-build
path: build

windows-mingw:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
EVHTP_MATRIX:
- Debug

steps:
- uses: actions/[email protected]

- name: Cache MinGW
id: cache-mingw-cmake
uses: actions/[email protected]
with:
path: D:\a\_temp\msys
key: windows-mingw-cmake

- name: Cache Build
uses: actions/[email protected]
with:
path: build
key: mingw-cmake-${{ matrix.EVHTP_MATRIX }}

- uses: numworks/setup-msys2@v1
if: steps.cache-mingw-cmake.outputs.cache-hit != 'true'
with:
msystem: MINGW64

- name: Install Dependes
if: steps.cache-mingw-cmake.outputs.cache-hit != 'true'
run: |
msys2do pacman -S --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-libevent mingw-w64-x86_64-oniguruma
- name: Build And Test
shell: powershell
run: |
if ( "${{ matrix.EVHTP_MATRIX }}" -ne "Debug" ) {
$EVHTP_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Debug"
}
$env:PATH="D:\a\_temp\msys\msys64\mingw64\bin;D:\a\_temp\msys\msys64;$env:PATH"
mkdir build -ea 0
cd build
cmake .. -G "MSYS Makefiles" $EVHTP_CMAKE_OPTIONS -DCMAKE_C_FLAGS=-w
cmake --build .
- uses: actions/upload-artifact@v1
if: failure()
with:
name: mingw-${{ matrix.EVHTP_MATRIX }}-build
path: build
107 changes: 107 additions & 0 deletions gha.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
name: linux

on:
pull_request:
types: [opened, synchronize]
paths-ignore:
- '**.md'
- '.mailmap'
- 'ChangeLog*'
- 'whatsnew*'
- 'LICENSE'
push:
paths-ignore:
- '**.md'
- '.mailmap'
- 'ChangeLog*'
- 'whatsnew*'
- 'LICENSE'

jobs:
linux-cmake:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04]
EVHTP_MATRIX:
- Debug

steps:
- uses: actions/[email protected]
- name: Cache Build
uses: actions/[email protected]
with:
path: build
key: ${{ matrix.os }}-cmake-${{ matrix.EVHTP_MATRIX }}

- name: Build And Test
shell: bash
run: |
apt install libevent-dev libonig-dev
if [ "${{ matrix.EVHTP_MATRIX }}" == "Debug" ]; then
EVHTP_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Debug"
fi
mkdir -p build
cd build
echo [cmake]: cmake .. $EVHTP_CMAKE_OPTIONS
cmake .. $EVHTP_CMAKE_OPTIONS
cmake --build .
- uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.os }}-cmake-${{ matrix.EVHTP_MATRIX }}-build
path: build

windows-mingw:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
EVHTP_MATRIX:
- Debug

steps:
- uses: actions/[email protected]

- name: Cache MinGW
id: cache-mingw-cmake
uses: actions/[email protected]
with:
path: D:\a\_temp\msys
key: windows-mingw-cmake

- name: Cache Build
uses: actions/[email protected]
with:
path: build
key: mingw-cmake-${{ matrix.EVHTP_MATRIX }}

- uses: numworks/setup-msys2@v1
if: steps.cache-mingw-cmake.outputs.cache-hit != 'true'
with:
msystem: MINGW64

- name: Install Dependes
if: steps.cache-mingw-cmake.outputs.cache-hit != 'true'
run: |
msys2do pacman -S --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-libevent mingw-w64-x86_64-libonig
- name: Build And Test
shell: powershell
run: |
if ( "${{ matrix.EVHTP_MATRIX }}" -ne "Debug" ) {
$EVHTP_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Debug"
}
$env:PATH="D:\a\_temp\msys\msys64\mingw64\bin;$env:PATH"
mkdir build -ea 0
cd build
cmake .. -G "MinGW Makefiles" $EVHTP_CMAKE_OPTIONS -DCMAKE_C_FLAGS=-w
cmake --build .
- uses: actions/upload-artifact@v1
if: failure()
with:
name: mingw-${{ matrix.EVHTP_MATRIX }}-build
path: build

0 comments on commit 79b6c60

Please sign in to comment.