tool4d-action

tool4d action

This action install the wanted tool4d to launch your 4D code.

Inputs

Choose the tool4d version

The parametrised URL used to download the tool4d is:

https://resources-download.4d.com/release/<product-line>/<version>/<build>/<os>/tool4d_<os or arch>.tar.xz

Launch a project

var $r : Real
var $startupParam: Text
$r:=Get database parameter(User param value; $startupParam)

Outputs

Example

A full running example could be found here: https://github.com/e-marchand/tool4d-action-test

Launch with default parameters

name: Unit Tests
on:
 ... 

jobs:
  build:
    name: "Run on macOS"
    runs-on: macos-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v4
    - uses: 4d/tool4d-action@v2
      with:
        project: "*"

💡 without project parameter no tool4d will be launch

Choose default method to launch

Here we choose to launch runUnitTests method.

name: Unit Tests
on:
 ... 

jobs:
  build:
    name: "Run on macOS"
    runs-on: macos-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v4
    - uses: 4d/tool4d-action@v2
      with:
        project: "*"
        startup-method: runUnitTests

Launch a specific method on macOS and windows

Using matrix, we could factorize. Here a full example

name: Unit Tests
on:
  push:
    branches:
      - main
    paths-ignore:
      - 'README.md'
  pull_request:
    branches:
      - main
    paths-ignore:
      - 'README.md'

jobs:
  build:
    name: "Run on $"
    strategy:
      fail-fast: false
      matrix:
        os: [ macos-latest, windows-latest ]
    runs-on: $
    steps:
    - name: Checkout
      uses: actions/checkout@v4
    - uses: 4d/tool4d-action@v2
      id: tool4d
      with:
        project: $/Project/Build4D_DF.4DProject
        startup-method: runUnitTests

Manage errors

Create an error file in current working directory to notify action of some failures. (4D code do not allow to exit/quit with a specific exit code)

Run on your own runner

GitHub runner have a lot of tools pre-installed. You could see some description in this repository

On Window you will need in your PATH