Skip to content

Update environment variables in GitHub Actions workflow to use main p… #15

Update environment variables in GitHub Actions workflow to use main p…

Update environment variables in GitHub Actions workflow to use main p… #15

Workflow file for this run

name: build
on:
push:
paths-ignore: ['**.md', '.vscode/**','docs/**','pictures/**']
#branches:
# - main
pull_request:
types: [opened, synchronize, reopened]
paths-ignore: ['**.md', '.vscode/**','docs/**','pictures/**']
env:
#TOOL4D_PRODUCT_LINE: 'vcs'
#TOOL4D_VERSION: 'vcs'
#TOOL4D_BUILDNUMBER : 'official'
TOOL4D_PRODUCT_LINE: 'main'
TOOL4D_VERSION: 'main'
TOOL4D_BUILDNUMBER : '297768'
jobs:
build:
name: "Build on ${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
os: [ windows-latest,macos-latest]
#os: [ ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: 📄 Checkout repository
uses: actions/checkout@v4
with:
lfs: true
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Checkout build4d-action
uses: actions/checkout@v4
with:
repository: 4d/build4d-action
token: ${{ secrets.GH_4D_ACTION_TOKEN }}
path: .github/actions/build4d-action
- name: Checkout tool4d-action
uses: actions/checkout@v4
with:
repository: 4d/tool4d-action
token: ${{ secrets.GH_4D_ACTION_TOKEN }}
path: .github/actions/tool4d-action
- name: Checkout setup4d-action
uses: actions/checkout@v4
with:
repository: 4d/setup4d-action
token: ${{ secrets.GH_4D_ACTION_TOKEN }}
path: .github/actions/setup4d-action
- name: 🏗️ Build ${{ github.event.repository.name }}
uses: ./.github/actions/build4d-action
with:
project: ${{ github.workspace }}/${{ github.event.repository.name }}/Project/${{ github.event.repository.name }}.4DProject
product-line: ${{env.TOOL4D_PRODUCT_LINE}}
version: ${{env.TOOL4D_VERSION}}
actions: "build,pack"
build: ${{env.TOOL4D_BUILDNUMBER}}
token: ${{ secrets.TOOL4D_DL_TOKEN }}
ignore-warnings: true
- name: 🚚 Copy ${{ github.event.repository.name }}.4dbase to ${{ github.event.repository.name }}_UnitTests/Components directory
run: |
cp -r ${{ github.workspace }}/${{ github.event.repository.name }}/build/ ${{ github.workspace }}/${{ github.event.repository.name }}_UnitTests/Components
- name: 🏗️ Build ${{ github.event.repository.name }}_UnitTests
uses: ./.github/actions/build4d-action
with:
project: ${{ github.workspace }}/${{ github.event.repository.name }}_UnitTests/Project/${{ github.event.repository.name }}_UnitTests.4DProject
product-line: ${{env.TOOL4D_PRODUCT_LINE}}
version: ${{env.TOOL4D_VERSION}}
build: ${{env.TOOL4D_BUILDNUMBER}}
actions: "build"
token: ${{ secrets.TOOL4D_DL_TOKEN }}
ignore-warnings: true
- name: Prepare Setup4d
uses: ./.github/actions/setup4d-action
with:
product-line: ${{env.TOOL4D_PRODUCT_LINE}}
version: ${{env.TOOL4D_VERSION}}
build: ${{env.TOOL4D_BUILDNUMBER}}
token: ${{ secrets.SETUP4D_DL_TOKEN }}
- name: 🧪 Run Unit Tests
uses: ./.github/actions/tool4d-action
with:
project: ${{ github.event.repository.name }}_UnitTests/Project/${{ github.event.repository.name }}_UnitTests.4DProject
product-line: ${{env.TOOL4D_PRODUCT_LINE}}
version: ${{env.TOOL4D_VERSION}}
build: ${{env.TOOL4D_BUILDNUMBER}}
token: ${{ secrets.TOOL4D_DL_TOKEN }}
startup-method: runAutomaticUnitTests
- name : 🚢 Archive Actifacts
uses: actions/upload-artifact@v4
with:
name: "UT-${{ github.event.repository.name }}.${{runner.os}}.text"
path: "UT-${{ github.event.repository.name }}.txt"
# Recherche de la chaîne "GLOBAL RESULT : SUCCESS" dans le fichier UT-${{ github.event.repository.name }}.txt
- name : ✔ Analyze result test
shell: bash
run: |
if grep -r "GLOBAL RESULT : SUCCESS" "UT-${{ github.event.repository.name }}.txt"; then
echo "Unit tests passed"
exit 0
else
echo "Unit tests failed"
exit 1
fi