7
7
build :
8
8
name : ${{ matrix.compiler }}-${{ matrix.version }} (${{ matrix.os }})
9
9
runs-on : ${{ matrix.os }}
10
+ defaults :
11
+ run :
12
+ shell : bash
10
13
strategy :
11
14
fail-fast : false
12
15
matrix :
81
84
version : 0.54.0
82
85
container : phhargrove/lfortran:0.54.0-1
83
86
87
+ # https://github.com/lfortran/lfortran/pkgs/container/lfortran
88
+ - os : ubuntu-22.04
89
+ compiler : lfortran
90
+ version : latest
91
+ container : ghcr.io/lfortran/lfortran:latest
92
+
84
93
container :
85
94
image : ${{ matrix.container }}
86
95
89
98
FC : ${{ matrix.compiler }}
90
99
FFLAGS : ${{ matrix.extra_flags }}
91
100
FPM_FLAGS : --profile release --verbose
101
+ CHECK_ASSERT : --flag -DASSERTIONS 2>&1 | tee output ; test ${PIPESTATUS[0]} = $ERROR_STOP_CODE && grep -q "Assertion failure" output
92
102
93
103
steps :
94
104
- name : Checkout code
@@ -109,7 +119,13 @@ jobs:
109
119
run : |
110
120
set -x
111
121
apt update
112
- apt install -y build-essential pkg-config make git curl
122
+ apt install -y build-essential # pkg-config make git curl
123
+ # Add container lfortran to PATH:
124
+ if test "$FC" = "lfortran"; then \
125
+ echo "/app/bin" >> "$GITHUB_PATH" ; \
126
+ ls -alh /app/bin ; \
127
+ ls -alh /app/share/lfortran/lib/ ; \
128
+ fi
113
129
114
130
- name : Install macOS Dependencies
115
131
if : contains(matrix.os, 'macos') && matrix.compiler == 'flang'
@@ -162,8 +178,9 @@ jobs:
162
178
163
179
- name : Version info
164
180
run : |
165
- set -x
166
181
echo == TOOL VERSIONS ==
182
+ echo PATH="$PATH"
183
+ set -x
167
184
uname -a
168
185
if test -r /etc/os-release ; then cat /etc/os-release ; fi
169
186
${FPM_FC} --version
@@ -178,22 +195,20 @@ jobs:
178
195
fpm run --example invoke-via-macro ${FPM_FLAGS} --flag "$FFLAGS"
179
196
180
197
- name : Build and Test (Assertions ON)
181
- env :
182
- FPM_FLAGS : ${{ env.FPM_FLAGS }} --flag -DASSERTIONS
183
198
run : |
184
199
set -x
185
- fpm test ${FPM_FLAGS} --flag "$FFLAGS"
186
- ( set +e ; fpm run --example false-assertion ${FPM_FLAGS} --flag "$FFLAGS" ; test $? = $ERROR_STOP_CODE )
187
- ( set +e ; fpm run --example simple-assertions ${FPM_FLAGS} --flag "$FFLAGS" ; test $? = $ERROR_STOP_CODE )
188
- ( set +e ; fpm run --example invoke-via-macro ${FPM_FLAGS} --flag "$FFLAGS" ; test $? = $ERROR_STOP_CODE )
200
+ fpm test ${FPM_FLAGS} --flag "$FFLAGS" --flag -DASSERTIONS
201
+ ( set +e ; eval fpm run --example false-assertion ${FPM_FLAGS} --flag \ "$FFLAGS\" $CHECK_ASSERT )
202
+ ( set +e ; eval fpm run --example simple-assertions ${FPM_FLAGS} --flag \ "$FFLAGS\" $CHECK_ASSERT )
203
+ ( set +e ; eval fpm run --example invoke-via-macro ${FPM_FLAGS} --flag \ "$FFLAGS\" $CHECK_ASSERT )
189
204
190
205
- name : Test Assertions w/ Parallel Callbacks
191
- if : ${{ matrix.compiler != 'lfortran' }} # issue #68
206
+ if : ${{ matrix.compiler != 'lfortran' || matrix.version == 'latest' }} # issue #68
192
207
env :
193
208
FPM_FLAGS : ${{ env.FPM_FLAGS }} --flag -DASSERT_MULTI_IMAGE --flag -DASSERT_PARALLEL_CALLBACKS
194
209
run : |
195
210
set -x
196
211
fpm run --example false-assertion ${FPM_FLAGS} --flag "$FFLAGS"
197
212
fpm run --example invoke-via-macro ${FPM_FLAGS} --flag "$FFLAGS"
198
- ( set +e ; fpm run --example false-assertion ${FPM_FLAGS} --flag "$FFLAGS -DASSERTIONS" ; test $? = $ERROR_STOP_CODE )
199
- ( set +e ; fpm run --example invoke-via-macro ${FPM_FLAGS} --flag "$FFLAGS -DASSERTIONS" ; test $? = $ERROR_STOP_CODE )
213
+ ( set +e ; eval fpm run --example false-assertion ${FPM_FLAGS} --flag \ "$FFLAGS\" $CHECK_ASSERT )
214
+ ( set +e ; eval fpm run --example invoke-via-macro ${FPM_FLAGS} --flag \ "$FFLAGS\" $CHECK_ASSERT )
0 commit comments