diff --git a/.github/actions/build-linux/action.yml b/.github/actions/build-linux/action.yml new file mode 100644 index 00000000..1388afcd --- /dev/null +++ b/.github/actions/build-linux/action.yml @@ -0,0 +1,43 @@ +name: 'Build Linux' +description: 'Build ths packages for Linux package' +runs: + using: "composite" + steps: + - name: Install prerequisites + shell: bash + run: | + sudo apt-get update -y + sudo apt-get install -y libboost-all-dev + sudo apt-get install -y libcurl4-openssl-dev + sudo apt-get install -y cmake + + - name: Xerces-C - prepare + shell: bash + run: | + mkdir xerces-c + cd xerces-c + curl -o xerces-c.zip https://dlcdn.apache.org//xerces/c/3/sources/xerces-c-3.2.5.zip + unzip xerces-c.zip -d . && mv xerces-c-*/* . + + # libMVRGdtf expects XMLChar be uint16_t + - name: Xerces-C - build + shell: bash + working-directory: xerces-c + run: | + ./configure --disable-shared --enable-xmlch-uint16_t --prefix=$(pwd)/_build + make -j + make install + + - name: libMVRGdtf - checkout repository + uses: actions/checkout@v4 + with: + path: libMvrGdtf + + - name: libMVRGdtf - build + shell: bash + working-directory: libMvrGdtf + run: | + mkdir build + cd build + cmake .. -DUNITTEST=TRUE -DEXTRA_LIBS="curl;icuuc;icudata;icui18n;icuio" -DXERCES_LIB_PATH="$(pwd)/../../xerces-c/_build/lib/libxerces-c.a" + make -j diff --git a/.github/workflows/build-linux-artifact.yml b/.github/workflows/build-linux-artifact.yml new file mode 100644 index 00000000..9f44e54a --- /dev/null +++ b/.github/workflows/build-linux-artifact.yml @@ -0,0 +1,29 @@ +name: Build Static Linux + +on: + [workflow_call, workflow_dispatch] + +jobs: + build_artifact: + runs-on: ubuntu-latest + name: Export a Linux build as an artifact + steps: + - uses: actions/checkout@v4 # https://github.com/nektos/act/issues/307 + - name: Build + uses: ./.github/actions/build-linux + + - name: Prepare Artifact + working-directory: libMvrGdtf + run: | + mkdir -p output/include + cp -r src/Include/* output/include/ + + mkdir -p output/lib + cp -r libs/* output/lib/ + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: libMVRgdtf-linux + path: | + libMvrGdtf/output diff --git a/.github/workflows/build-static.yml b/.github/workflows/build-static.yml index 4032ae52..3e00d045 100644 --- a/.github/workflows/build-static.yml +++ b/.github/workflows/build-static.yml @@ -370,74 +370,5 @@ jobs: path: | libMvrGdtf/output - build_linux: - - runs-on: ubuntu-latest - - steps: - # -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - # Install curl - - name: Install prerequisites - run: | - sudo apt-get update -y - sudo apt-get install -y libboost-all-dev - sudo apt-get install -y libcurl4-openssl-dev - sudo apt-get install -y cmake - - # -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - # Xerces-C - setup and build - # we need to compile it ourselves because libMVRGdtf expects XMLChar be uint16_t - - name: Xerces-C - prepare - run: | - mkdir xerces-c - cd xerces-c - curl -o xerces-c.zip https://dlcdn.apache.org//xerces/c/3/sources/xerces-c-3.2.5.zip - unzip xerces-c.zip -d . && mv xerces-c-*/* . - - - name: Xerces-C - build - working-directory: xerces-c - run: | - ./configure --disable-shared --enable-xmlch-uint16_t --prefix=$(pwd)/_build - make -j - make install - - # -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - # libMVRGdtf - checkout repository - - name: libMVRGdtf - checkout repository - uses: actions/checkout@v4 - with: - path: libMvrGdtf - - # -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - # libMVRGdtf - setup and build and test - - name: libMVRGdtf - build - working-directory: libMvrGdtf - run: | - mkdir build - cd build - cmake .. -DUNITTEST=TRUE -DEXTRA_LIBS="curl;icuuc;icudata;icui18n;icuio" -DXERCES_LIB_PATH="$(pwd)/../../xerces-c/_build/lib/libxerces-c.a" - make -j - - # -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - name: Collect Artifact - working-directory: libMvrGdtf - run: | - mkdir -p output/include - cp -r src/Include/* output/include/ - - mkdir -p output/lib - cp -r libs/* output/lib/ - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: libMVRgdtf-linux - path: | - libMvrGdtf/output - - - - - - + uses: ./.github/workflows/build-linux-artifact.yml diff --git a/.github/workflows/linux-unittest.yml b/.github/workflows/linux-unittest.yml index 4918d979..3d79b97f 100644 --- a/.github/workflows/linux-unittest.yml +++ b/.github/workflows/linux-unittest.yml @@ -4,56 +4,14 @@ on: [push, workflow_dispatch] jobs: - build: + test: runs-on: ubuntu-latest - steps: - # -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - # Install curl - - name: Install prerequisites - run: | - sudo apt-get update -y - sudo apt-get install -y libboost-all-dev - sudo apt-get install -y libcurl4-openssl-dev - sudo apt-get install -y cmake - - # -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - # Xerces-C - setup and build - # we need to compile it ourselves because libMVRGdtf expects XMLChar be uint16_t - - name: Xerces-C - prepare - run: | - mkdir xerces-c - cd xerces-c - curl -o xerces-c.zip https://dlcdn.apache.org//xerces/c/3/sources/xerces-c-3.2.5.zip - unzip xerces-c.zip -d . && mv xerces-c-*/* . - - - name: Xerces-C - build - working-directory: xerces-c - run: | - ./configure --disable-shared --enable-xmlch-uint16_t --prefix=$(pwd)/_build - make -j - make install - - # -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - # libMVRGdtf - checkout repository - - name: libMVRGdtf - checkout repository - uses: actions/checkout@v4 - with: - path: libMvrGdtf - - # -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - # libMVRGdtf - setup and build and test - - name: libMVRGdtf - build - working-directory: libMvrGdtf - run: | - mkdir build - cd build - cmake .. -DUNITTEST=TRUE -DEXTRA_LIBS="curl;icuuc;icudata;icui18n;icuio" -DXERCES_LIB_PATH="$(pwd)/../../xerces-c/_build/lib/libxerces-c.a" - make -j - - - name: Testing... - working-directory: libMvrGdtf/build - run: | - ./MvrGdtfUnitTest - - + - uses: actions/checkout@v4 # https://github.com/nektos/act/issues/307 + - name: Build + uses: ./.github/actions/build-linux + + - name: Testing... + working-directory: libMvrGdtf/build + run: | + ./MvrGdtfUnitTest