From 52402f6a1cad79f5b8f7d1831ef3c3fd4387db62 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Mon, 29 May 2023 19:58:36 +0200 Subject: [PATCH] CI: Check compiler warnings. Add checks to make CI fail by compiler warnings in the `rake compile`. If the `skip-warnings` (default: `false`, as an undefined variable is evaluated as `false` in the `if` syntax) is `true` in specific matrix cases, the cases skip the checks. If you want to skip new compiler warnings coming from external changes such as upgraded compiler or OpenSSL versions in the specific matrix cases, you can set the `skip-warnings: true` for the cases. --- .github/workflows/test.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84b0580b2..30bda38cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,6 +47,10 @@ jobs: run: echo "MAKEFLAGS=V=1" >> $GITHUB_ENV if: runner.os == 'Linux' || runner.os == 'macOS' + - name: set flags to check compiler warnings. + run: echo "RUBY_OPENSSL_EXTCFLAGS=-Werror" >> $GITHUB_ENV + if: ${{ !matrix.skip-warnings }} + - name: compile run: rake compile -- --enable-debug @@ -142,6 +146,10 @@ jobs: run: echo "MAKEFLAGS=V=1" >> $GITHUB_ENV if: runner.os == 'Linux' || runner.os == 'macOS' + - name: set flags to check compiler warnings. + run: echo "RUBY_OPENSSL_EXTCFLAGS=-Werror" >> $GITHUB_ENV + if: ${{ !matrix.skip-warnings }} + - name: compile run: rake compile -- --enable-debug --with-openssl-dir=$HOME/.openssl/${{ matrix.openssl }}