Start of helios lib and wasm build #564
Workflow file for this run
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: Helios Build | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
helios_version_major: ${{ steps.set_version.outputs.helios_version_major }} | |
helios_version_minor: ${{ steps.set_version.outputs.helios_version_minor }} | |
helios_build_number: ${{ steps.set_version.outputs.helios_build_number }} | |
helios_version_number: ${{ steps.set_version.outputs.helios_version_number }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetches all history for all branches and tags | |
- name: Determine Version and Build Number | |
id: set_version | |
run: | | |
# Fetch all tags | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
# Get the latest tag that matches the branch suffix | |
LATEST_TAG=$(git tag --list | sort -V | tail -n1) | |
if [ -z "$LATEST_TAG" ]; then | |
echo "No matching tags found. Setting default version." | |
VERSION_MAJOR="0" | |
VERSION_MINOR="1" | |
BUILD_NUMBER="0" | |
else | |
echo "Found latest tag: $LATEST_TAG" | |
VERSION_MAJOR=$(echo $LATEST_TAG | cut -d. -f1) | |
VERSION_MINOR=$(echo $LATEST_TAG | cut -d. -f2) | |
LAST_HELIOS_BUILD_NUMBER=$(echo $LATEST_TAG | cut -d. -f3) | |
COMMITS_SINCE_TAG=$(git rev-list --count $LATEST_TAG..HEAD) | |
BUILD_NUMBER=$(( $LAST_HELIOS_BUILD_NUMBER + $COMMITS_SINCE_TAG )) | |
fi | |
FULL_VERSION="$VERSION_MAJOR.$VERSION_MINOR.$BUILD_NUMBER" | |
echo "helios_version_major=$VERSION_MAJOR" >> $GITHUB_OUTPUT | |
echo "helios_version_minor=$VERSION_MINOR" >> $GITHUB_OUTPUT | |
echo "helios_build_number=$BUILD_NUMBER" >> $GITHUB_OUTPUT | |
echo "helios_version_number=$FULL_VERSION" >> $GITHUB_OUTPUT | |
echo "Version Number: $FULL_VERSION" | |
build: | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout current repository | |
uses: actions/checkout@v4 | |
- name: Update Package Lists | |
run: sudo apt-get update | |
- name: Install Dependencies | |
run: sudo apt-get install valgrind g++ make --fix-missing | |
- name: Build HeliosCLI | |
run: make -j | |
working-directory: HeliosCLI | |
- name: Archive HeliosCLI artifacts | |
run: zip -r "helioscli.zip" . | |
working-directory: HeliosCLI | |
- name: Upload HeliosCLI Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: helioscli-artifacts | |
path: HeliosCLI/helioscli.zip | |
tests: | |
needs: [setup, build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout current repository | |
uses: actions/checkout@v4 | |
- name: Download HeliosCLI Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: helioscli-artifacts | |
path: ./HeliosCLI | |
- name: Set execute permissions for test script | |
run: chmod +x ./runtests.sh | |
working-directory: tests | |
- name: Run general tests | |
run: ./runtests.sh | |
working-directory: tests | |
embedded: | |
needs: [setup, build, tests] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout current repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install Dependencies | |
run: make install | |
working-directory: HeliosEmbedded | |
- name: Build Binary | |
run: | | |
export HELIOS_VERSION_MAJOR=${{ needs.setup.outputs.helios_version_major }} | |
export HELIOS_VERSION_MINOR=${{ needs.setup.outputs.helios_version_minor }} | |
export HELIOS_BUILD_NUMBER=${{ needs.setup.outputs.helios_build_number }} | |
export HELIOS_VERSION_NUMBER=${{ needs.setup.outputs.helios_version_number }} | |
make -j build | |
working-directory: HeliosEmbedded | |
- name: Archive HeliosEmbedded artifacts | |
run: zip -r "embedded-firmware.zip" . | |
working-directory: HeliosEmbedded | |
- name: Upload HeliosEmbedded Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: embedded-firmware | |
path: HeliosEmbedded/embedded-firmware.zip | |
wasm: | |
needs: [setup, build, tests, embedded] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout current repository | |
uses: actions/checkout@v4 | |
- name: Update Package Lists | |
run: sudo apt-get update | |
- name: Install Emscripten | |
run: | | |
sudo apt install -y cmake python3 | |
git clone https://github.com/emscripten-core/emsdk.git | |
cd emsdk | |
./emsdk install latest | |
./emsdk activate latest | |
working-directory: HeliosLib | |
- name: Build Webassembly | |
run: | | |
source ./emsdk/emsdk_env.sh | |
export HELIOS_VERSION_MAJOR=${{ needs.setup.outputs.helios_version_major }} | |
export HELIOS_VERSION_MINOR=${{ needs.setup.outputs.helios_version_minor }} | |
export HELIOS_BUILD_NUMBER=${{ needs.setup.outputs.helios_build_number }} | |
export HELIOS_VERSION_NUMBER=${{ needs.setup.outputs.helios_version_number }} | |
make -j wasm | |
working-directory: HeliosLib |