Skip to content

Commit

Permalink
CI: Add an option to make CI fail by compiler warnings.
Browse files Browse the repository at this point in the history
If the `fail_by_warn` is `true` in the case on CI, the case fails by the
compiler warnings by the `rake compile`.
  • Loading branch information
junaruga committed Jun 7, 2023
1 parent 6f1c061 commit 9f8b2ac
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
# ubuntu-22.04 uses OpenSSL 3.0, ubuntu-20.04 uses OpenSSL 1.1.1
os: [ ubuntu-22.04, ubuntu-20.04, macos-latest, windows-latest ]
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
fail_by_warn: [ true ]
exclude:
# uses non-standard MSYS2 OpenSSL 3 package
- { os: windows-latest, ruby: head }
Expand Down Expand Up @@ -47,6 +48,10 @@ jobs:
run: echo "MAKEFLAGS=V=1" >> $GITHUB_ENV
if: runner.os == 'Linux' || runner.os == 'macOS'

- name: set flags to fail by the compiler warnings.
run: echo "RUBY_OPENSSL_EXTCFLAGS=-Werror" >> $GITHUB_ENV
if: matrix.fail_by_warn

- name: compile
run: rake compile -- --enable-debug

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

- name: set flags to fail by the compiler warnings.
run: echo "RUBY_OPENSSL_EXTCFLAGS=-Werror" >> $GITHUB_ENV
if: matrix.fail_by_warn

- name: compile
run: rake compile -- --enable-debug --with-openssl-dir=$HOME/.openssl/${{ matrix.openssl }}

Expand Down

0 comments on commit 9f8b2ac

Please sign in to comment.