Update mssf version 0.0.12 (#76) #406
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: build | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
BUILD_TYPE: ["Debug"] | |
os: [ windows-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Get specific version CMake, v3.21.2 | |
uses: lukka/[email protected] | |
- name: Install rust stable | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: 1.79.0 | |
components: rustfmt, clippy | |
- name: Run cargo check | |
run: cargo check | |
- name: Run cargo fmt | |
run: cargo fmt --all -- --check | |
- name: Run cargo clippy | |
run: cargo clippy -- -D warnings | |
- name: run cmake | |
run: > | |
cmake . -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -B build | |
- name: run build | |
run: cmake --build build --config ${{ matrix.BUILD_TYPE }} | |
# mysql bin has conflicting dlls with fabric than prevents fabric from starting | |
- name: Remove conflict dll paths | |
shell: powershell | |
run: | | |
get-command libprotobuf.dll | format-list | |
Remove-Item -Recurse -Force "C:\Program Files\MySQL\MySQL Server 8.0\bin" | |
- name: check sf exist | |
run: Powershell.exe -File .\scripts\check_sf_installed.ps1 | |
# Creates a 5 node dev cluster | |
- name: start sf cluster | |
run: Powershell.exe -File "C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\DevClusterSetup.ps1" | |
- name: start connection | |
run: Powershell.exe -File .\scripts\check_cluster_online.ps1 | |
- name: provision apps and run tests | |
shell: powershell | |
run: | | |
# The test will add and remove app | |
.\tests\echo_script_test.ps1 | |
.\scripts\echomain_stateful_ctl2.ps1 -Action Add | |
.\scripts\echomain_ctl.ps1 -Action Add | |
- name: Run cargo test | |
run: cargo test --all -- --nocapture | |
build-linux: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
BUILD_TYPE: ["Debug"] | |
os: [ ubuntu-20.04 ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: apt-get | |
run: sudo apt-get update && sudo apt-get install apt-transport-https curl lsb-release wget gnupg2 software-properties-common debconf-utils clang lld -y | |
- name: install sf | |
run: | | |
wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb; | |
sudo dpkg -i packages-microsoft-prod.deb; | |
curl -fsSL https://packages.microsoft.com/keys/msopentech.asc | sudo apt-key add - ; | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - ; | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" ; | |
sudo apt-get update; | |
echo "servicefabric servicefabric/accepted-eula-ga select true" | sudo debconf-set-selections ; | |
echo "servicefabricsdkcommon servicefabricsdkcommon/accepted-eula-ga select true" | sudo debconf-set-selections ; | |
sudo apt-get install servicefabricsdkcommon -y; | |
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/microsoft/servicefabric/bin/Fabric/Fabric.Code" >> $GITHUB_ENV | |
- name: Get specific version CMake, v3.21.2 | |
uses: lukka/[email protected] | |
- name: Install rust stable | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: 1.79.0 | |
components: rustfmt, clippy | |
- name: Run cargo check | |
run: cargo check | |
- name: Run cargo fmt | |
run: cargo fmt --all -- --check | |
- name: Run cargo clippy | |
run: cargo clippy -- -D warnings | |
- name: run cmake | |
run: > | |
cmake . -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -B build | |
- name: run build | |
run: cmake --build build --config ${{ matrix.BUILD_TYPE }} | |
- name: install sfctl | |
run: | | |
pip3 install -I sfctl==11.1.0 | |
echo "~/.local/bin" >> $GITHUB_PATH | |
- name: test sfctl | |
run: sfctl --version | |
- name: start sf | |
run: sudo /opt/microsoft/sdk/servicefabric/common/clustersetup/devclustersetup.sh | |
- name: test cluster health | |
run: | | |
set +e # do not exit on error | |
counter=0 | |
COMMAND_STATUS=1 | |
until [ $COMMAND_STATUS -eq 0 ]; do | |
echo "attempt #${counter}" | |
sfctl cluster select | |
COMMAND_STATUS=$? | |
sleep 1 | |
let counter=counter+1 | |
if [[ $counter -eq 10 ]] ; | |
then | |
echo "Retry max reached" && exit 1 | |
fi | |
done | |
sfctl cluster health | |
- name: run echo app | |
run: | | |
sleep 120 # wait for cluster to be up | |
sfctl application upload --path build/echoapp_root | |
sfctl application provision --application-type-build-path echoapp_root | |
sfctl application create --app-name fabric:/EchoApp --app-type EchoApp --app-version 0.0.1 | |
# TODO: this fails in CI | |
# - name: resolve service | |
# run: | | |
# sleep 120 # wait for app to be up | |
# sfctl service resolve --service-id EchoApp/EchoAppService | |
- name: Run cargo test | |
run: cargo test --all -- --nocapture |