Fix verify response SHA512 string serialization #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 0.20.x | |
| pull_request: | |
| branches: | |
| - main | |
| - 0.20.x | |
| workflow_dispatch: | |
| jobs: | |
| format-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install clang-format | |
| run: | | |
| sudo apt update -y | |
| sudo apt install -y lsb-release wget software-properties-common gnupg | |
| wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm-snapshot.gpg | |
| echo "deb [signed-by=/usr/share/keyrings/llvm-snapshot.gpg] http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list | |
| sudo apt update -y | |
| sudo apt remove -y clang-format 2>/dev/null || true | |
| sudo apt install -y clang-format-21 | |
| sudo ln -sf /usr/bin/clang-format-21 /usr/bin/clang-format | |
| - name: Check code formatting | |
| run: | | |
| ./clang-format.sh | |
| if ! git diff --quiet; then | |
| git diff | |
| echo "" | |
| echo "Please run './clang-format.sh' and commit the changes." | |
| exit 1 | |
| fi | |
| build-linux: | |
| needs: [format-check] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| # Define all possible variables | |
| matrix: | |
| compiler: [gcc, clang] | |
| build_type: [Debug, Release] | |
| pg_version: [14, 15, 17] | |
| # Exclude the unwanted v14 combinations | |
| exclude: | |
| - pg_version: 14 | |
| compiler: gcc | |
| build_type: Debug | |
| - pg_version: 14 | |
| compiler: gcc | |
| build_type: Release | |
| - pg_version: 14 | |
| compiler: clang | |
| build_type: Release | |
| - pg_version: 15 | |
| compiler: gcc | |
| build_type: Debug | |
| - pg_version: 15 | |
| compiler: gcc | |
| build_type: Release | |
| - pg_version: 15 | |
| compiler: clang | |
| build_type: Release | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Dependencies | |
| run: | | |
| sudo apt update -y | |
| sudo apt install -y \ | |
| git gcc clang clang-tools cmake make \ | |
| libev4 libev-dev libssl-dev libsystemd-dev \ | |
| zlib1g zlib1g-dev libzstd-dev liblz4-dev \ | |
| libssh-dev libatomic1 \ | |
| python3-docutils libbz2-dev libarchive-dev \ | |
| bzip2 net-tools check libyaml-dev llvm | |
| - name: Install PostgreSQL v${{ matrix.pg_version }} | |
| run: | | |
| sudo apt install curl ca-certificates | |
| sudo install -d /usr/share/postgresql-common/pgdg | |
| sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | |
| sudo sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | |
| sudo apt update | |
| sudo apt install -y postgresql-${{ matrix.pg_version }} postgresql-server-dev-${{ matrix.pg_version }} | |
| - name: Set Env Path Variable | |
| run: | | |
| echo "PATH=/usr/lib/postgresql/${{ matrix.pg_version }}/bin:$PATH" >> $GITHUB_ENV | |
| echo $PATH | |
| - name: Install pgmoneta_ext | |
| run: | | |
| git_repo="https://github.com/pgmoneta/pgmoneta_ext.git" | |
| cd /tmp/ | |
| git clone --branch "main" --single-branch --depth 1 "$git_repo" | |
| cd /tmp/pgmoneta_ext/ | |
| mkdir build | |
| cd /tmp/pgmoneta_ext/build/ | |
| cmake -DDOCS=false .. | |
| make | |
| sudo make install | |
| - name: Build Project | |
| run: | | |
| mkdir build | |
| cd build | |
| if [ "${{ matrix.compiler }}" = "gcc" ]; then | |
| export CC=/usr/bin/gcc | |
| else | |
| export CC=/usr/bin/clang | |
| fi | |
| cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DDOCS=FALSE .. | |
| make -j$(nproc) | |
| working-directory: /home/runner/work/pgmoneta/pgmoneta/ | |
| - name: Run Tests | |
| run: | | |
| export TEST_PG_VERSION=${{ matrix.pg_version }} | |
| if [ "${{ matrix.compiler }}" = "clang" ] && [ "${{ matrix.build_type }}" = "Debug" ]; then | |
| $(which bash) ./test/check.sh ci | |
| fi | |
| working-directory: /home/runner/work/pgmoneta/pgmoneta/ | |
| - name: Report coverage summary | |
| if: matrix.compiler == 'clang' && matrix.build_type == 'Debug' | |
| run: | | |
| echo "## Coverage Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| cat /tmp/pgmoneta-test/coverage/coverage-report-*.txt >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| - name: Upload All Coverage Reports as Artifact | |
| if: always() | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: coverage-reports-${{ matrix.compiler }}-${{ matrix.build_type }}-${{ matrix.pg_version }} | |
| path: /tmp/pgmoneta-test/coverage | |
| retention-days: 90 | |
| - name: Upload Run Log as Artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: logs-${{ matrix.compiler }}-${{ matrix.build_type }}-${{ matrix.pg_version }} | |
| path: /tmp/pgmoneta-test/log | |
| retention-days: 90 |