Skip to content

Update README.md

Update README.md #18

# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: Release FMUTOOL
on:
push:
branches: [ "main" ]
tags:
- '*'
pull_request:
branches: [ "main" ]
jobs:
compile-windows32:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=cl
-DCMAKE_C_COMPILER=cl
-DCMAKE_BUILD_TYPE=Release
-A Win32
-S ${{ github.workspace }}/remoting
- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release
- name: Archive Artifacts
uses: actions/upload-artifact@master
with:
name: binaries-win32
path: ${{ github.workspace }}/fmutool/remoting/win32/
retention-days: 1
compile-windows64:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=cl
-DCMAKE_C_COMPILER=cl
-DCMAKE_BUILD_TYPE=Release
-A x64
-S ${{ github.workspace }}/remoting
- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release
- name: Archive Artifacts
uses: actions/upload-artifact@master
with:
name: binaries-win64
path: ${{ github.workspace }}/fmutool/remoting/win64
retention-days: 1
compile-linux32:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Install needed packets
run: >
sudo apt-get install gcc-multilib
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=g++
-DCMAKE_C_COMPILER=gcc
-DCMAKE_BUILD_TYPE=Release
-DBUILD_32=ON
-S ${{ github.workspace }}/remoting
- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release
- name: Archive Artifacts
uses: actions/upload-artifact@master
with:
name: binaries-linux32
path: ${{ github.workspace }}/fmutool/remoting/linux32/client_sm.so
retention-days: 1
compile-linux64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=g++
-DCMAKE_C_COMPILER=gcc
-DCMAKE_BUILD_TYPE=Release
-S ${{ github.workspace }}/remoting
- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release
- name: Archive Artifacts
uses: actions/upload-artifact@master
with:
name: binaries-linux64
path: ${{ github.workspace }}/fmutool/remoting/linux64
retention-days: 1
package:
needs: [compile-windows32, compile-windows64, compile-linux32, compile-linux64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@master
with:
name: binaries-win64
path: ${{ github.workspace }}/fmutool/remoting/win64/
- uses: actions/download-artifact@master
with:
name: binaries-win32
path: ${{ github.workspace }}/fmutool/remoting/win32/
- uses: actions/download-artifact@master
with:
name: binaries-linux32
path: ${{ github.workspace }}/fmutool/remoting/linux32/
- uses: actions/download-artifact@master
with:
name: binaries-linux64
path: ${{ github.workspace }}/fmutool/remoting/linux64/
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Package
run: |
python setup.py build --build-lib=build
- name: Test with pytest
run: |
cd tests
python -munittest -v test_suite.py
- name: Archive Artifacts
uses: actions/upload-artifact@master
with:
name: package
path: ${{ github.workspace }}/build
retention-days: 1