1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-07-04 12:03:41 +02:00

CI: combine mac,unix,win jobs into one and use matrix + control steps via "if" and $RUNNER_OS variable.

This commit is contained in:
Henrik Hautakoski 2020-01-15 17:42:55 +01:00
parent 725ba47e34
commit 8c8e586b2c

View file

@ -8,54 +8,44 @@ on:
- '!master' - '!master'
jobs: jobs:
unix: compile:
name: compile - Ubuntu
runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
build-opts: [ "-DUSE_THREADS=ON", "-DUSE_THREADS=OFF" ] build-opts: [ "-DUSE_THREADS=ON", "-DUSE_THREADS=OFF" ]
name: ${{matrix.os}} (${{matrix.build-opts}})
runs-on: ${{matrix.os}}
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Configure
run: mkdir build && cd build && cmake ${{matrix.build-opts}} ..
- name: Build
run: cmake --build build
mac:
name: compile - MacOS
runs-on: macos-latest
strategy:
matrix:
build-opts: [ "-DUSE_THREADS=ON", "-DUSE_THREADS=OFF" ]
steps:
- uses: actions/checkout@v1
- name: Dependancies
run: brew install openssl
- name: Configure
run: mkdir build && cd build && cmake ${{matrix.build-opts}} -D OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1 ..
- name: Build
run: cmake --build build
win:
name: compile - windows
runs-on: windows-latest
strategy:
matrix:
build-opts: [ "-DUSE_THREADS=ON", "-DUSE_THREADS=OFF" ]
steps:
- uses: actions/checkout@v1
- name: Dependancies - name: Dependancies
shell: bash
run: | run: |
mkdir build; cd build mkdir -p build
Invoke-WebRequest -Uri https://mirror.firedaemon.com/OpenSSL/openssl-1.1.1e-dev.zip -OutFile openssl.zip if [ "$RUNNER_OS" == "macOS" ]; then
Expand-Archive openssl.zip brew install openssl
- name: Configure elif [ "$RUNNER_OS" == "Windows" ]; then
run: cd build; cmake ${{matrix.build-opts}} -D OPENSSL_ROOT_DIR="$pwd\openssl\openssl-1.1\x64" .. cd build
curl https://mirror.firedaemon.com/OpenSSL/openssl-1.1.1e-dev.zip -O
7z x openssl-1.1.1e-dev.zip
fi
- name: Configure (nix)
if: runner.os != 'Windows'
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
SSL_OPTS="-D OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1"
fi
cd build && cmake ${SSL_OPTS} ${{matrix.build-opts}} ..
- name: Configure (win)
if: runner.os == 'Windows'
# cmake in windows bash can't find openssl. so we use windows cli.
run: cd build; cmake ${{matrix.build-opts}} -D OPENSSL_ROOT_DIR="$pwd\openssl-1.1\x64" ..
- name: Build - name: Build
shell: bash
run: cmake --build build run: cmake --build build