-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (70 loc) · 2.6 KB
/
test.lazarus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Lazarus Test Workflow
defaults:
run:
shell: bash
on:
workflow_call:
inputs:
config:
description: A JSON object containing configuration values
required: true
type: string
fail-fast:
description: Fail Fast on the jobs
required: true
type: boolean
jobs:
test-app:
name: test [${{ matrix.os }}] [${{ matrix.lazarus-versions }}]
runs-on: ${{ matrix.os }}
env:
_EXE_: ${{
matrix.os == 'windows-latest' &&
format('{0}.exe', fromJSON(inputs.config).app-name) ||
fromJSON(inputs.config).app-name
}}
strategy:
matrix: ${{ fromJSON(inputs.config).matrix }}
fail-fast: ${{ inputs.fail-fast }}
steps:
- name: Build env from inputs.config
run: |
(
echo "app-name=${{ fromJSON(inputs.config).app-name }}"
echo "lpi-path=${{ fromJSON(inputs.config).lpi-path }}"
echo "bin-path=${{ fromJSON(inputs.config).bin-path }}"
echo "build-mode=${{ fromJSON(inputs.config).build-mode }}"
echo "lazarus-packages=${{ fromJSON(inputs.config).lazarus-packages }}"
echo "what-suite=${{ fromJSON(inputs.config).what-suite }}"
echo "output-format=${{ fromJSON(inputs.config).output-format }}"
) >> "$GITHUB_ENV"
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: true
- name: Install Lazarus
uses: gcarreno/setup-lazarus@v3
with:
lazarus-version: ${{ matrix.lazarus-versions }}
include-packages: "${{ env.lazarus-packages }}"
with-cache: false
- name: Build the Test App
run: lazbuild -B --bm="${{ env.build-mode }}" "${{ env.lpi-path }}/${{ env.app-name }}.lpi"
- name: Run the tests
run: |
if [ "${{ env.what-suite }}" == "all" ];then
${{ env.bin-path }}/${{ env._EXE_ }} --all --format="${{ env.output-format }}"
else
${{ env.bin-path }}/${{ env._EXE_ }} --suite="${{ env.what-suite }}" --format="${{ env.output-format }}"
fi
# - name: Print some values
# run: |
# echo Config: ${{ inputs.config }}
# echo App Name: ${{ env.app-name }}
# echo LPI Path: ${{ env.lpi-path }}/${{ env.app-name }}.lpi
# echo BIN Path: ${{ env.bin-path }}/${{ env._EXE_ }}
# echo What tests: ${{ env.what-tests }}
# echo Output format: ${{ env.output-format }}
# echo Matrix OS: ${{ matrix.os }}
# echo Executable: ${{ env._EXE_ }}