-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add arm64 workflows. Split out reusable code into reusable actions.
Closes #501
- Loading branch information
Showing
6 changed files
with
257 additions
and
119 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# 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: Build Middleware | ||
description: Reusable action to build omega-edit middleware | ||
inputs: | ||
runner-os: | ||
description: 'OS Name of Runner (macOS, Linux, Windows)' | ||
required: true | ||
os-name: | ||
description: 'OS Name (runs-on value)' | ||
required: true | ||
runs: | ||
using: "composite" | ||
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 directory to store lib files 🔧 | ||
shell: bash | ||
run: mkdir -p _install | ||
|
||
- name: Download macOS library file 🔻 | ||
uses: actions/download-artifact@v4 | ||
if: inputs.runner-os == 'macOS' | ||
with: | ||
name: ${{ inputs.os-name }}-libomega_edit.dylib | ||
path: _install/libomega_edit.dylib | ||
|
||
- name: Download Linux library file 🔻 | ||
uses: actions/download-artifact@v4 | ||
if: inputs.runner-os == 'Linux' | ||
with: | ||
name: ${{ inputs.os-name }}-libomega_edit.so | ||
path: _install/libomega_edit.so | ||
|
||
- name: Download Windows library file 🔻 | ||
uses: actions/download-artifact@v4 | ||
if: inputs.runner-os == 'Windows' | ||
with: | ||
name: omega_edit.dll | ||
path: _install/omega_edit.dll | ||
|
||
- name: Move out library file 🛻 | ||
run: | | ||
if [[ ${{ inputs.runner-os }} == 'Linux' ]]; then | ||
CURRENT_LIB_FILENAME="${{ inputs.runner-os }}-libomega_edit.so" | ||
LIB_FILENAME="libomega_edit.so" | ||
elif [[ ${{ inputs.runner-os }} == 'macOS' ]]; then | ||
CURRENT_LIB_FILENAME="${{ inputs.runner-os }}-libomega_edit.dylib" | ||
LIB_FILENAME="libomega_edit.dylib" | ||
else | ||
CURRENT_LIB_FILENAME="omega_edit.dll" | ||
LIB_FILENAME="omega_edit.dll" | ||
fi | ||
mv -v "_install/${CURRENT_LIB_FILENAME}" "_install/${CURRENT_LIB_FILENAME}_dir" | ||
mv -v "_install/${CURRENT_LIB_FILENAME}_dir/$CURRENT_LIB_FILENAME" "_install/$LIB_FILENAME" | ||
rm -rf "_install/${CURRENT_LIB_FILENAME}_dir" | ||
shell: bash | ||
|
||
- name: Check Scala headers ✔️ | ||
shell: bash | ||
run: sbt headerCheckAll | ||
working-directory: server/scala | ||
|
||
- name: Package Scala API - Non windows 🎁 | ||
shell: bash | ||
run: sbt installM2 # runs test so specifically running sbt test not needed # TODO: Make sure tests run on windows | ||
if: inputs.runner-os != 'Windows' | ||
working-directory: server/scala | ||
# timeout-minutes: 30 | ||
|
||
- name: Package Scala Native - Windows 🎁 | ||
shell: bash | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: inputs.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@v4 | ||
if: success() || failure() | ||
with: | ||
name: ${{ inputs.os-name }}-artifacts | ||
path: ~/.m2/repository/com/ctc/* | ||
if-no-files-found: error | ||
|
||
- name: Test Scala RPC server 📋 | ||
shell: bash | ||
run: sbt serv/test | ||
if: inputs.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: inputs.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: inputs.runner-os != 'Windows' # TODO: Make sure tests run on windows | ||
run: yarn workspace @omega-edit/client test | ||
shell: bash | ||
# timeout-minutes: 30 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# 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: Build Native | ||
description: Reusable action for building native code | ||
inputs: | ||
runner-os: | ||
description: 'OS Name of Runner (macOS, Linux, Windows)' | ||
required: true | ||
os-name: | ||
description: 'OS Name (runs-on value)' | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Enable Developer Command Prompt 💻 | ||
if: inputs.runner-os == 'Windows' | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
|
||
- name: Setup cmake 🔧 | ||
uses: lukka/get-cmake@latest | ||
|
||
- name: Prepare, Build, Test, and Install Ωedit™- Non Windows 🔧 | ||
if: inputs.runner-os != 'Windows' | ||
shell: bash | ||
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: Prepare, Build, Test, and Install Ωedit™ - Windows 🔧 | ||
if: inputs.runner-os == 'Windows' | ||
shell: pwsh | ||
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@v4 | ||
if: inputs.runner-os == 'macOS' | ||
with: | ||
name: ${{ inputs.os-name }}-libomega_edit.dylib | ||
path: _install/lib/libomega_edit.dylib | ||
|
||
- name: Upload Native (.so) library - Linux 🔺 | ||
uses: actions/upload-artifact@v4 | ||
if: inputs.runner-os == 'Linux' | ||
with: | ||
name: ${{ inputs.os-name }}-libomega_edit.so | ||
path: _install/lib/libomega_edit.so | ||
|
||
- name: Upload Native (.dll) library - Windows 🔺 | ||
uses: actions/upload-artifact@v4 | ||
if: inputs.runner-os == 'Windows' | ||
with: | ||
name: omega_edit.dll | ||
path: _install/bin/omega_edit.dll |
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
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
Oops, something went wrong.