git » sdk » main » tree

[main] / .github / workflows / build.yml

name: Build

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:

    runs-on: ubuntu-24.04

    steps:
    - uses: actions/checkout@v4

    - name: System Dependencies
      run: |
        sudo sh -c 'echo deb https://www.deb-multimedia.org sid main non-free > /etc/apt/sources.list.d/dm.list'
        sudo apt-get update -oAcquire::AllowInsecureRepositories=true
        sudo apt-get install --allow-unauthenticated deb-multimedia-keyring
        sudo apt-get update
        sudo apt-get install -y haxe libstrophe-dev libopus-dev libdatachannel-dev
        haxelib setup ~/haxe

    - name: Cache haxelib
      id: cache-npm
      uses: actions/cache@v3
      env:
        cache-name: cache-haxelib
      with:
        path: ~/haxe
        key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/build.yml') }}
        restore-keys: |
          ${{ runner.os }}-build-${{ env.cache-name }}-
          ${{ runner.os }}-build-
          ${{ runner.os }}-

    - name: Haxe Dependencies
      run: |
        haxelib --quiet git jsImport https://github.com/back2dos/jsImport
        haxelib --quiet install datetime
        haxelib --quiet install haxe-strings
        haxelib --quiet install hsluv
        haxelib --quiet install tink_http
        haxelib --quiet install sha
        haxelib --quiet install thenshim
        haxelib --quiet install HtmlParser
        haxelib --quiet install hxnodejs
        haxelib --quiet git hxtsdgen https://github.com/singpolyma/hxtsdgen
        haxelib --quiet install utest
        haxelib --quiet git hxcpp https://github.com/singpolyma/hxcpp update-sqlite
        cd ~/haxe/hxcpp/git/tools/hxcpp
        haxe compile.hxml

    - name: NPM Dependencies
      run: |
        cd npm
        npm config set maxsockets 2
        npm i

    - name: Tests
      run: make test

    - name: Build
      run: make

    - name: libborogove Artifact
      uses: actions/upload-artifact@v4
      with:
        name: libborogove
        path: |
          libborogove.so
          cpp/borogove.h

    - name: NPM Tarball
      run: tar -cjf npm.tar.gz npm/

    - name: JS Artifact
      uses: actions/upload-artifact@v4
      with:
        name: npm.tar.gz
        path: |
          npm.tar.gz