feat: docker support (#67) #129
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CPPKiteConnect-test | |
# Get triggered on | |
on: | |
push: | |
branches: [main, v2] | |
pull_request: | |
branches: [main, v2] | |
release: | |
jobs: | |
# This job builds and runs unit tests | |
build-and-test: | |
# Define a strategy | |
strategy: | |
# Matrix of configs to test | |
matrix: | |
config: | |
- { name: ubuntu, os: ubuntu-latest } | |
- { name: macOS, os: macos-latest } | |
#TODO - { name: windows, os: windows-latest } | |
name: ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
steps: | |
# Check out repo with submodules | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
# Build & test on Linux | |
- name: Build and test on (Ubuntu) Linux | |
if: startsWith(matrix.config.name, 'ubuntu') | |
run: | | |
sudo apt update && sudo apt -y install libssl-dev zlib1g-dev git g++ build-essential cmake googletest google-mock libgtest-dev libgmock-dev doxygen | |
git clone https://github.com/hoytech/uWebSockets.git | |
cd uWebSockets && make && sudo make install && cd .. | |
mkdir build && cd build | |
cmake .. -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON && make && make test ARGS="-V" | |
# Build & test on macOS | |
- name: Build and test on macOS | |
if: startsWith(matrix.config.name, 'macOS') | |
run: | | |
brew extract --version=1.10.0 googletest homebrew/cask-versions && brew install [email protected] libuv | |
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig" | |
curl -L https://github.com/hoytech/uWebSockets/archive/refs/tags/v0.14.8.tar.gz > uWebSocketsv-0.14.8.tar.gz | |
tar -xvf uWebSocketsv-0.14.8.tar.gz | |
cd uWebSockets-0.14.8 | |
make && make installDarwin && cd .. | |
mkdir build && cd build | |
cmake .. -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON && make && make test ARGS="-V" |