From fc04a81bb0f9c4cd4867035f91e1bfc236077b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Sat, 4 Apr 2020 21:16:06 -0700 Subject: [PATCH] Setup GitHub CI --- .github/workflows/unit_tests.yml | 90 ++++++++++++++++++++++++++++++++ .travis.yml | 38 -------------- 2 files changed, 90 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/unit_tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml new file mode 100644 index 0000000..d9716e5 --- /dev/null +++ b/.github/workflows/unit_tests.yml @@ -0,0 +1,90 @@ +name: Unit Tests + +on: + pull_request: + branches: [ master ] + +jobs: + Sqlite: + runs-on: ubuntu-latest + container: kanboard/tests:latest + steps: + - name: Checkout Kanboard repo + uses: actions/checkout@v2 + with: + repository: kanboard/kanboard + - name: Checkout Plugin repo + uses: actions/checkout@v2 + with: + path: plugins/Calendar + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest + - name: Unit tests with Sqlite + run: ./vendor/bin/phpunit -c tests/units.sqlite.xml plugins/Calendar/Test/ + + Postgres: + runs-on: ubuntu-latest + container: kanboard/tests:latest + services: + postgres: + image: postgres:9.4 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - name: Checkout Kanboard repo + uses: actions/checkout@v2 + with: + repository: kanboard/kanboard + - name: Checkout Plugin repo + uses: actions/checkout@v2 + with: + path: plugins/Calendar + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest + - name: Unit tests with Postgres + run: ./vendor/bin/phpunit -c tests/units.postgres.xml plugins/Calendar/Test/ + env: + DB_HOSTNAME: postgres + DB_PORT: ${{ job.services.postgres.ports[5432] }} + + MariaDB: + runs-on: ubuntu-latest + container: kanboard/tests:latest + services: + mariadb: + image: mariadb:latest + env: + MYSQL_ROOT_PASSWORD: secret + ports: + - 3306:3306 + options: >- + --health-cmd "mysqladmin ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - name: Checkout Kanboard repo + uses: actions/checkout@v2 + with: + repository: kanboard/kanboard + - name: Checkout Plugin repo + uses: actions/checkout@v2 + with: + path: plugins/Calendar + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest + - name: Unit tests with MariaDB + run: ./vendor/bin/phpunit -c tests/units.mysql.xml plugins/Calendar/Test/ + env: + DB_HOSTNAME: mariadb + DB_PASSWORD: secret + DB_PORT: ${{ job.services.mariadb.ports[3306] }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8d0a7b1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,38 +0,0 @@ -language: php -sudo: false -notifications: - email: false - -services: - - postgresql - - mysql - -php: - - 7.4 - - 7.3 - - 7.2 - -env: - global: - - PLUGIN=Calendar - - KANBOARD_REPO=https://github.com/kanboard/kanboard.git - matrix: - - DB=sqlite - - DB=mysql - - DB=postgres - -matrix: - fast_finish: true - -install: - - git clone --depth 1 $KANBOARD_REPO - - ln -s $TRAVIS_BUILD_DIR kanboard/plugins/$PLUGIN - -before_script: - - cd kanboard - - phpenv config-add tests/php.ini - - composer install - - ls -la plugins/ - -script: - - ./vendor/bin/phpunit -c tests/units.$DB.xml plugins/$PLUGIN/Test/