|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ['**'] # Only run on branches |
| 6 | + tags-ignore: ['*'] # Ignore all tags |
| 7 | + paths-ignore: ['**.md', '.vscode/**','docs/**','pictures/**'] |
| 8 | + pull_request: |
| 9 | + types: [opened, synchronize, reopened] |
| 10 | + paths-ignore: ['**.md', '.vscode/**','docs/**','pictures/**'] |
| 11 | + |
| 12 | +env: |
| 13 | + TOOL4D_PRODUCT_LINE: '20Rx' |
| 14 | + TOOL4D_VERSION: '20R10' |
| 15 | + TOOL4D_BUILDNUMBER : '100221' |
| 16 | + SETUP4D_PRODUCT_LINE: 'Rx' |
| 17 | + SETUP4D_VERSION: '20R10' |
| 18 | + SETUP4D_BUILDNUMBER : '100221' |
| 19 | + |
| 20 | +jobs: |
| 21 | + build: |
| 22 | + name: "Build on ${{ matrix.os }}" |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + os: [ windows-latest,macos-latest] |
| 27 | + |
| 28 | + |
| 29 | + runs-on: ${{ matrix.os }} |
| 30 | + steps: |
| 31 | + - name: 📄 Checkout repository |
| 32 | + uses: actions/checkout@v4 |
| 33 | + with: |
| 34 | + lfs: true |
| 35 | + # Disabling shallow clone is recommended for improving relevancy of reporting |
| 36 | + fetch-depth: 0 |
| 37 | + |
| 38 | + |
| 39 | + - name: Checkout build4d-action |
| 40 | + uses: actions/checkout@v4 |
| 41 | + with: |
| 42 | + repository: 4d/build4d-action |
| 43 | + token: ${{ secrets.GH_4D_ACTION_TOKEN }} |
| 44 | + path: .github/actions/build4d-action |
| 45 | + |
| 46 | + - name: Checkout tool4d-action |
| 47 | + uses: actions/checkout@v4 |
| 48 | + with: |
| 49 | + repository: 4d/tool4d-action |
| 50 | + token: ${{ secrets.GH_4D_ACTION_TOKEN }} |
| 51 | + path: .github/actions/tool4d-action |
| 52 | + |
| 53 | + - name: Checkout setup4d-action |
| 54 | + uses: actions/checkout@v4 |
| 55 | + with: |
| 56 | + repository: 4d/setup4d-action |
| 57 | + token: ${{ secrets.GH_4D_ACTION_TOKEN }} |
| 58 | + path: .github/actions/setup4d-action |
| 59 | + |
| 60 | + |
| 61 | + - name: 🏗️ Build ${{ github.event.repository.name }} |
| 62 | + uses: ./.github/actions/build4d-action |
| 63 | + with: |
| 64 | + project: ${{ github.workspace }}/${{ github.event.repository.name }}/Project/${{ github.event.repository.name }}.4DProject |
| 65 | + product-line: ${{env.TOOL4D_PRODUCT_LINE}} |
| 66 | + version: ${{env.TOOL4D_VERSION}} |
| 67 | + actions: "build,pack" |
| 68 | + build: ${{env.TOOL4D_BUILDNUMBER}} |
| 69 | + token: ${{ secrets.TOOL4D_DL_TOKEN }} |
| 70 | + ignore-warnings: true |
| 71 | + |
| 72 | + - name: 🚚 Copy ${{ github.event.repository.name }}.4dbase to ${{ github.event.repository.name }}_UnitTests/Components directory |
| 73 | + run: | |
| 74 | + cp -r ${{ github.workspace }}/${{ github.event.repository.name }}/build/ ${{ github.workspace }}/${{ github.event.repository.name }}_UnitTests/Components |
| 75 | +
|
| 76 | + - name: Download Setup4d |
| 77 | + uses: ./.github/actions/setup4d-action |
| 78 | + with: |
| 79 | + product-line: ${{env.SETUP4D_PRODUCT_LINE}} |
| 80 | + version: ${{env.SETUP4D_VERSION}} |
| 81 | + build-number: ${{env.SETUP4D_BUILDNUMBER}} |
| 82 | + token: ${{ secrets.SETUP4D_DL_TOKEN }} |
| 83 | + |
| 84 | + - name: Move 4DSetup work directory to UnitTests project Work directory |
| 85 | + run: | |
| 86 | + mv ${{ github.workspace }}/.github/actions/setup4d-action/work/ ${{ github.workspace }}/${{ github.event.repository.name }}_UnitTests/Work/ |
| 87 | +
|
| 88 | + - name: 🏗️ Build ${{ github.event.repository.name }}_UnitTests |
| 89 | + uses: ./.github/actions/build4d-action |
| 90 | + with: |
| 91 | + project: ${{ github.workspace }}/${{ github.event.repository.name }}_UnitTests/Project/${{ github.event.repository.name }}_UnitTests.4DProject |
| 92 | + product-line: ${{env.TOOL4D_PRODUCT_LINE}} |
| 93 | + version: ${{env.TOOL4D_VERSION}} |
| 94 | + build: ${{env.TOOL4D_BUILDNUMBER}} |
| 95 | + actions: "build" |
| 96 | + token: ${{ secrets.TOOL4D_DL_TOKEN }} |
| 97 | + ignore-warnings: true |
| 98 | + |
| 99 | + #- name: 🧪 Run Unit Tests |
| 100 | + # uses: ./.github/actions/tool4d-action |
| 101 | + # with: |
| 102 | + # project: ${{ github.event.repository.name }}_UnitTests/Project/${{ github.event.repository.name }}_UnitTests.4DProject |
| 103 | + # product-line: ${{env.TOOL4D_PRODUCT_LINE}} |
| 104 | + # version: ${{env.TOOL4D_VERSION}} |
| 105 | + # build: ${{env.TOOL4D_BUILDNUMBER}} |
| 106 | + # token: ${{ secrets.TOOL4D_DL_TOKEN }} |
| 107 | + # startup-method: runAutomaticUnitTests |
| 108 | + |
| 109 | + #- name : 🚢 Archive Actifacts |
| 110 | + # uses: actions/upload-artifact@v4 |
| 111 | + # with: |
| 112 | + # name: "UT-${{ github.event.repository.name }}.${{runner.os}}.text" |
| 113 | + # path: "UT-${{ github.event.repository.name }}.txt" |
| 114 | + |
| 115 | + # Recherche de la chaîne "GLOBAL RESULT : SUCCESS" dans le fichier UT-${{ github.event.repository.name }}.txt |
| 116 | + #- name : ✔ Analyze result test |
| 117 | + # shell: bash |
| 118 | + # run: | |
| 119 | + # if grep -r "GLOBAL RESULT : SUCCESS" "UT-${{ github.event.repository.name }}.txt"; then |
| 120 | + # echo "Unit tests passed" |
| 121 | + # exit 0 |
| 122 | + # else |
| 123 | + # echo "Unit tests failed" |
| 124 | + # exit 1 |
| 125 | + # fi |
| 126 | + |
| 127 | + |
| 128 | + |
| 129 | + |
| 130 | + |
0 commit comments