various fixes for Windows #1791
Workflow file for this run
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
# Copyright (c) 2021 Concurrent Technologies Corporation. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software is distributed under the License is | |
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |
# implied. See the License for the specific language governing permissions and limitations under the License. | |
--- | |
name: Unit Tests | |
on: | |
push: | |
branches: | |
- '**' | |
jobs: | |
build-native: | |
strategy: | |
matrix: | |
os: [ windows-2019, macos-11, ubuntu-20.04 ] # NOTE: build on older OS versions to support older OS versions | |
fail-fast: false # don't immediately fail all other jobs if a single job fails | |
name: Native build and test on ${{ matrix.os }} 🦙 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Enable Developer Command Prompt 💻 | |
if: runner.os == 'Windows' | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v4 | |
- name: Setup cmake 🔧 | |
uses: lukka/get-cmake@latest | |
- name: Prepare, Build, Test, and Install Ωedit™ 🔧 | |
run: | | |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON --install-prefix "${PWD}/_install" | |
cmake --build build --config Release | |
ctest -C Release --test-dir build/core --output-on-failure | |
cmake --install build/packages/core --prefix "${PWD}/_install" --config Release | |
- name: Upload Native (.dylib) library - Macos 🔺 | |
uses: actions/upload-artifact@v3 | |
if: runner.os == 'macOS' | |
with: | |
name: libomega_edit.dylib | |
path: _install/lib/libomega_edit.dylib | |
- name: Upload Native (.so) library - Linux 🔺 | |
uses: actions/upload-artifact@v3 | |
if: runner.os == 'Linux' | |
with: | |
name: libomega_edit.so | |
path: _install/lib/libomega_edit.so | |
- name: Upload Native (.dll) library - Windows 🔺 | |
uses: actions/upload-artifact@v3 | |
if: runner.os == 'Windows' | |
with: | |
name: omega_edit.dll | |
path: _install/bin/omega_edit.dll | |
build-middleware: | |
needs: [ build-native ] | |
strategy: | |
matrix: | |
os: [ macos-11, ubuntu-20.04, windows-2019 ] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
name: Build middleware ${{ matrix.os }} 🔧 | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v4 | |
- name: Setup Java ☕ | |
uses: actions/[email protected] | |
with: | |
distribution: temurin | |
java-version: 8 | |
cache: sbt | |
- name: Make _install/lib directory to store lib files 🔧 | |
run: mkdir -p _install/lib | |
- name: Download macOS library file 🔻 | |
uses: actions/download-artifact@v3 | |
if: runner.os == 'macOS' | |
with: | |
name: libomega_edit.dylib | |
path: _install/lib/libomega_edit.dylib | |
- name: Download Linux library file 🔻 | |
uses: actions/download-artifact@v3 | |
if: runner.os == 'Linux' | |
with: | |
name: libomega_edit.so | |
path: _install/lib/libomega_edit.so | |
- name: Download Windows library file 🔻 | |
uses: actions/download-artifact@v3 | |
if: runner.os == 'Windows' | |
with: | |
name: omega_edit.dll | |
path: _install/lib/omega_edit.dll | |
- name: Move out library file 🛻 | |
run: | | |
if [[ ${{ runner.os }} == 'Linux' ]]; then | |
LIB_FILENAME="libomega_edit.so" | |
elif [[ ${{ runner.os }} == 'macOS' ]]; then | |
LIB_FILENAME="libomega_edit.dylib" | |
else | |
LIB_FILENAME="omega_edit.dll" | |
fi | |
mv -v "_install/lib/${LIB_FILENAME}" "_install/lib/${LIB_FILENAME}_dir" | |
mv -v "_install/lib/${LIB_FILENAME}_dir/$LIB_FILENAME" "_install/lib/$LIB_FILENAME" | |
rm -rf "_install/lib/${LIB_FILENAME}_dir" | |
shell: bash | |
- name: Check Scala headers ✔️ | |
run: sbt headerCheckAll | |
working-directory: server/scala | |
- name: Package Scala API - Non windows 🎁 | |
run: sbt installM2 # runs test so specifically running sbt test not needed # TODO: Make sure tests run on windows | |
if: runner.os != 'Windows' | |
working-directory: server/scala | |
timeout-minutes: 30 | |
- name: Package Scala Native - Windows 🎁 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: runner.os == 'Windows' # TODO: Remove, current workaround so we can download all OS jars from tests for release | |
run: sbt native/publishM2 | |
working-directory: server/scala | |
- name: Archive M2 🔺 | |
uses: actions/upload-artifact@v3 | |
if: success() || failure() | |
with: | |
name: ${{ matrix.os }}-artifacts | |
path: ~/.m2/repository/com/ctc/* | |
if-no-files-found: error | |
- name: Test Scala RPC server 📋 | |
run: sbt serv/test | |
if: runner.os != 'Windows' # TODO: Make sure tests run on windows | |
working-directory: server/scala | |
timeout-minutes: 30 | |
- name: Yarn Install 🏗️ | |
run: yarn | |
shell: bash | |
- name: Yarn Package - Server 📦 | |
if: runner.os != 'Windows' # TODO: Make sure tests run on windows | |
run: yarn workspace @omega-edit/server package | |
shell: bash | |
timeout-minutes: 30 | |
- name: Yarn Test - Client 🧑💼 | |
if: runner.os != 'Windows' # TODO: Make sure tests run on windows | |
run: yarn workspace @omega-edit/client test | |
shell: bash | |
timeout-minutes: 30 |