Skip to content

Commit 9f8b2ac

Browse files
committed
CI: Add an option to make CI fail by compiler warnings.
If the `fail_by_warn` is `true` in the case on CI, the case fails by the compiler warnings by the `rake compile`.
1 parent 6f1c061 commit 9f8b2ac

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
# ubuntu-22.04 uses OpenSSL 3.0, ubuntu-20.04 uses OpenSSL 1.1.1
2020
os: [ ubuntu-22.04, ubuntu-20.04, macos-latest, windows-latest ]
2121
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
22+
fail_by_warn: [ true ]
2223
exclude:
2324
# uses non-standard MSYS2 OpenSSL 3 package
2425
- { os: windows-latest, ruby: head }
@@ -47,6 +48,10 @@ jobs:
4748
run: echo "MAKEFLAGS=V=1" >> $GITHUB_ENV
4849
if: runner.os == 'Linux' || runner.os == 'macOS'
4950

51+
- name: set flags to fail by the compiler warnings.
52+
run: echo "RUBY_OPENSSL_EXTCFLAGS=-Werror" >> $GITHUB_ENV
53+
if: matrix.fail_by_warn
54+
5055
- name: compile
5156
run: rake compile -- --enable-debug
5257

@@ -79,6 +84,7 @@ jobs:
7984
- libressl-3.6.3
8085
- libressl-3.7.3
8186
- libressl-3.8.0 # Development release
87+
fail_by_warn: [ true ]
8288
fips-enabled: [ false ]
8389
include:
8490
- { os: ubuntu-latest, ruby: "3.0", openssl: openssl-3.0.9, fips-enabled: true, append-configure: 'enable-fips', name-extra: 'fips' }
@@ -142,6 +148,10 @@ jobs:
142148
run: echo "MAKEFLAGS=V=1" >> $GITHUB_ENV
143149
if: runner.os == 'Linux' || runner.os == 'macOS'
144150

151+
- name: set flags to fail by the compiler warnings.
152+
run: echo "RUBY_OPENSSL_EXTCFLAGS=-Werror" >> $GITHUB_ENV
153+
if: matrix.fail_by_warn
154+
145155
- name: compile
146156
run: rake compile -- --enable-debug --with-openssl-dir=$HOME/.openssl/${{ matrix.openssl }}
147157

0 commit comments

Comments
 (0)