version 0.5.0 #180
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
# https://github.com/actions/starter-workflows/blob/master/ci/cmake-multi-platform.yml | |
name: CMake on multiple platforms | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
env: | |
BUILD_TYPE: Release | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
jobs: | |
build: | |
# https://docs.github.com/actions/using-workflows/about-workflows#using-a-build-matrix | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# https://github.com/actions/runner-images | |
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, macos-14, macos-13, macos-12, windows-2022, windows-2019] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Export GitHub Actions cache environment variables | |
if: ${{ startsWith(matrix.os, 'windows') }} | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
- name: Install libevent and openssl on ubuntu | |
if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
run: sudo apt-get update && sudo apt-get install -y libevent-dev libssl-dev | |
- name: Install libevent and openssl on macos | |
if: ${{ startsWith(matrix.os, 'macos') }} | |
run: brew install libevent | |
- name: Install libevent and openssl on windows | |
if: ${{ startsWith(matrix.os, 'windows') }} | |
shell: bash | |
run: | | |
cp .github/vcpkg/${{matrix.os}}.json vcpkg.json | |
vcpkg install --triplet x64-windows-static | |
- name: Configure CMake on ubuntu and macos | |
if: ${{ startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos') }} | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
- name: Configure CMake on windows | |
if: ${{ startsWith(matrix.os, 'windows') }} | |
run: cmake -B ${{github.workspace}}\build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=c:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: Prepare test on ubuntu | |
if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
run: sudo apt-get install -y python3-socks | |
- name: Prepare test on macos | |
if: ${{ startsWith(matrix.os, 'macos') }} | |
run: brew install shadowsocks-rust && /usr/bin/pip3 install PySocks | |
- name: Prepare test on windows | |
if: ${{ startsWith(matrix.os, 'windows') }} | |
shell: bash | |
run: | | |
pip3 install PySocks | |
cp -v build/${{env.BUILD_TYPE}}/wss-proxy*.exe build/ | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{env.BUILD_TYPE}} -V | |
- name: Upload windows artifact | |
if: ${{ startsWith(matrix.os, 'windows') }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wss-proxy-client-openssl-${{ matrix.os == 'windows-2019' && '3.0' || '3.3' }} | |
path: | | |
build/${{env.BUILD_TYPE}}/wss-proxy-client.exe |