From b4f14a6bd07dcf43ca2ffe4287ab8a1294caebd1 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Tue, 27 Oct 2020 02:16:25 +0300 Subject: [PATCH] Switch CI to GitHub actions --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 42 -------------------------------------- README.md | 2 +- 3 files changed, 45 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c41a97a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: CI +on: [ push, pull_request ] +jobs: + build: + runs-on: ubuntu-20.04 + strategy: + matrix: + include: + - { libversion: master, postgresql: 11, cc: gcc } + # libversion versions + - { libversion: 3.0.1, postgresql: 11, cc: gcc } + - { libversion: 3.0.0, postgresql: 11, cc: gcc } + # compilers + - { libversion: master, postgresql: 11, cc: clang } + # postgresql versions + - { libversion: master, postgresql: 9.6, cc: gcc } + - { libversion: master, postgresql: 10, cc: gcc } + - { libversion: master, postgresql: 12, cc: gcc } + - { libversion: master, postgresql: 13, cc: gcc } + steps: + - uses: actions/checkout@v2 + - name: Install postgresql + run: | + sudo apt-get purge 'postgresql*' >/dev/null 2>&1 || true + sudo apt-get install postgresql-${{ matrix.postgresql }} postgresql-client-${{ matrix.postgresql }} postgresql-server-dev-${{ matrix.postgresql }} + sudo pg_ctlcluster ${{ matrix.postgresql }} main restart + sudo -u postgres createuser -s "$USER" || true + - name: Install libversion dependency + run: | + mkdir _libversion + cd _libversion + wget -qO- https://github.com/repology/libversion/archive/${{ matrix.libversion }}.tar.gz | tar -xzf- --strip-components 1 + cmake . + make + sudo make install + sudo ldconfig + - name: Build + run: make CC=${{ matrix.cc }} + - name: Install + run: sudo make install + - name: Installcheck + run: | + make installcheck + if test -e regression.diffs; then cat regression.diffs; false; fi diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6661274..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: c -dist: bionic -sudo: required -matrix: - include: - # supported libversion versions - - env: LIBVERSION=master - - env: LIBVERSION=3.0.1 - - env: LIBVERSION=3.0.0 - # different compilers - - env: LIBVERSION=master - compiler: gcc - - env: LIBVERSION=master - compiler: clang - # different PostgreSQL versions - - env: POSTGRESQL=9.6 LIBVERSION=master - - env: POSTGRESQL=10 LIBVERSION=master - - env: POSTGRESQL=11 LIBVERSION=master - - env: POSTGRESQL=12 LIBVERSION=master - - env: POSTGRESQL=13 LIBVERSION=master -before_install: - - |- - if [ -n "$POSTGRESQL" ]; then - sudo service postgresql stop - wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add - - sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' - sudo apt-get update - sudo apt-get install postgresql-$POSTGRESQL postgresql-client-$POSTGRESQL postgresql-server-dev-$POSTGRESQL - sudo sed -i -e 's|#*port = .*|port = 5432|' /etc/postgresql/$POSTGRESQL/main/postgresql.conf - sudo sed -i -e 's|peer|trust|' /etc/postgresql/$POSTGRESQL/main/pg_hba.conf - sudo pg_ctlcluster $POSTGRESQL main restart - sudo -u postgres createuser -s "$USER" || true - else - sudo apt-get install postgresql-server-dev-10 - fi - - - wget -qO- https://github.com/repology/libversion/archive/$LIBVERSION.tar.gz | tar -xzf- && ( cd libversion-$LIBVERSION && cmake . && make && sudo make install && sudo ldconfig ) -script: - - make - - sudo make install - - make installcheck - - if test -e regression.diffs; then cat regression.diffs; fi diff --git a/README.md b/README.md index 4424a7b..d6c6a4e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # postgresql-libversion -[![Build Status](https://travis-ci.org/repology/postgresql-libversion.svg?branch=master)](https://travis-ci.org/repology/postgresql-libversion) +![CI](https://github.com/repology/postgresql-libversion/workflows/CI/badge.svg) PostgreSQL extension with support for version string comparison through [libversion](https://github.com/repology/libversion).