A CI/CD template project
A CI/CD template project.
A 🌀Run Tests workflow is automatically triggered when code is changed in the main
branch.
This workflow does the following:
windows-latest
macos-latest
compiler
project from releasestool4d
--startup-method
with tool4d
and compiler
projectSample result: actions/runs/8025901243
Only changes relevant to code execution will trigger the workflow:
on:
push:
branches:
- main
paths:
- '*/Project/Sources/**/*.4dm'
- '*/Project/Sources/*/*.4DForm'
- '*/Project/Sources/*.4DCatalog'
A specific branch, product and build of tool4d
is used:
jobs:
get:
strategy:
fail-fast: false
matrix:
TOOL4D_PLATFORM: ["windows-latest", "macos-latest"]
TOOL4D_BRANCH: [20.x]
TOOL4D_VERSION: [20.2]
TOOL4D_BUILD: [latest]
runs-on: $
steps:
- name: checkout
uses: actions/checkout@v4
- name: get tool4d
id: get
uses: miyako/4D/.github/actions/tool4d-download@v1
with:
platform: $
branch: $
version: $
build: $
Any combination of runners, tool4d
, projects, --startup-method
can be specified in a strategy matrix:
jobs:
get:
strategy:
fail-fast: false
matrix:
TOOL4D_BUILD: [latest]
TOOL4D_STARTUP_METHOD: [test]
TOOL4D_STARTUP_PROJECT_PATH: [./application/Project/application.4DProject]
runs-on: $
steps:
- name: run tests
uses: ./.github/actions/run-tests
with:
tool4d_download_url: $
tool4d_executable_path: $
startup_method: $
project_path: $
A 🎉Build and Publish workflow can be trigged manually.
This workflow does the following:
patch
, minor
, major
package.json
at the root of the project (the version information in this file is incorporated in the build process)compiler
project from releasestool4d
Sample result: actions/runs/8026370678
This workflow is also triggered automatically, according to the same filter as 🌀Run Tests
.
compiler
project from releasestool4d
Sample result: actions/runs/8026309928
Because the deployment
job needs the release
job, it is important to checkout the repository with ref: $
to get the latest commit from the bump
job. Otherwise, the commit that is checked out would be from the moment the workflow was triggered which is a version behind.
Although one can configure the self-hosted runner application as a service, the codesign script seems to fail when executed in a background process (maybe there is a workaround, don’t know). For the purpose of building 4D applications, it seems better to ./ron.sh
the runner in a Terminal window, manually, or as a login item.