Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composable action for Linux build #52

Merged
merged 5 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/actions/build-linux/action.yml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 29 additions & 0 deletions .github/workflows/build-linux-artifact.yml
Original file line number Diff line number Diff line change
@@ -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
71 changes: 1 addition & 70 deletions .github/workflows/build-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
60 changes: 9 additions & 51 deletions .github/workflows/linux-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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