-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
92 lines (85 loc) · 2.82 KB
/
action.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
84
85
86
87
88
89
90
91
92
name: 'meson'
description: 'handle steps for meson setup/build/test/install/dist'
inputs:
actions:
description: 'meson action to perform'
type: 'string'
default: 'prefetch setup compile'
projectdir:
description: 'meson project root directory'
type: 'string'
default: '.'
builddir:
description: 'meson build directory'
type: 'string'
default: 'builddir'
cross_files:
description: 'cross file(s) to use'
type: 'string'
default: ''
options:
description: 'meson option to give at setup (with -D prefix)'
type: 'string'
default: ''
coverage:
description: 'build coverage reports'
type: 'boolean'
default: false
targets:
description: 'target to build'
type: 'string'
default: ''
shell:
description: 'shell to use'
type: 'string'
default: 'bash'
runs:
using: 'composite'
steps:
- name: 'Meson Prefetch'
if: ${{ contains(fromJSON(inputs.actions), 'prefetch') }}
working-directory: ${{ inputs.projectdir }}
shell: ${{ inputs.shell }}
run: |
meson subprojects download || true
meson subprojects foreach python3 -m pip install -r requirements.txt || true
- name: 'Meson Setup'
if: ${{ contains(fromJSON(inputs.actions), 'setup') }}
working-directory: ${{ inputs.projectdir }}
shell: ${{ inputs.shell }}
run: |
CROSS_FILES=
for f in ${{ inputs.cross_files }}; do
CROSS_FILES+=" --cross-file ${f} "
done
meson setup ${{ inputs.options }} ${CROSS_FILES} ${{ inputs.builddir }}
- name: 'Meson Compile'
if: ${{ contains(fromJSON(inputs.actions), 'compile') }}
working-directory: ${{ format('{0}/{1}', inputs.projectdir, inputs.builddir) }}
shell: ${{ inputs.shell }}
run: |
ninja ${{ inputs.targets }}
- name: 'Meson Test'
if: ${{ contains(fromJSON(inputs.actions), 'test') }}
working-directory: ${{ format('{0}/{1}', inputs.projectdir, inputs.builddir) }}
shell: ${{ inputs.shell }}
run: |
ninja test
- name: 'Meson Coverage Report'
if: ${{ contains(fromJSON(inputs.actions), 'test') && inputs.coverage == 'true' }}
working-directory: ${{ format('{0}/{1}', inputs.projectdir, inputs.builddir) }}
shell: ${{ inputs.shell }}
run: |
ninja coverage
- name: 'Meson Install'
if: ${{ contains(fromJSON(inputs.actions), 'install') }}
working-directory: ${{ format('{0}/{1}', inputs.projectdir, inputs.builddir) }}
shell: ${{ inputs.shell }}
run: |
ninja install
- name: 'Meson Dist'
if: ${{ contains(fromJSON(inputs.actions), 'dist') }}
working-directory: ${{ format('{0}/{1}', inputs.projectdir, inputs.builddir) }}
shell: ${{ inputs.shell }}
run: |
meson dist --no-tests --include-subprojects