From 7cef87e856dd26ba2ab002cf4ed59e478d657675 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sun, 31 May 2020 14:36:09 +0200 Subject: [PATCH] migrating TravisCI tests to GitHub actions --- .github/workflows/php.yml | 23 ------------------- .github/workflows/tests.yml | 44 +++++++++++++++++++++++++++++++++++++ .travis.yml | 35 ----------------------------- 3 files changed, 44 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/php.yml create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml deleted file mode 100644 index 8e856b81..00000000 --- a/.github/workflows/php.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: PHP Composer - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-suggest - - # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" - # Docs: https://getcomposer.org/doc/articles/scripts.md - - # - name: Run test suite - # run: composer run-script test diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..8fd8fb54 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,44 @@ +name: Tests +on: [push] + +jobs: + Composer: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Validate composer.json and composer.lock + run: composer validate + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest + PHPunit: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: [ubuntu-latest, windows-latest, macos-latest] + php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] + name: PHP ${{ matrix.php-versions }} unit tests on ${{ matrix.operating-system }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: gd, sqlite3 + tools: phpunit + Mocha: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: '12' + - name: Setup Mocha + run: npm install -g mocha + - name: Setup Node modules + run: cd js && npm install + - name: Run unit tests + run: mocha diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 92aea717..00000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -language: php -php: - - '5.6' - - '7.0' - - '7.1' - - '7.2' - - '7.3' - - '7.4' - -# as this is a php project, node.js (for JS unit testing) isn't installed -install: - - if [ ! -d "$HOME/.nvm" ]; then mkdir -p $HOME/.nvm && curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | NVM_METHOD=script bash; fi - - source ~/.nvm/nvm.sh && nvm install --lts - -before_script: - - rm composer.lock - - composer install -n - - npm install -g mocha - - cd js && npm install - -script: - - mocha - - cd ../tst && ../vendor/bin/phpunit - -after_script: - - ../vendor/bin/test-reporter --coverage-report log/coverage-clover.xml - - cd .. && vendor/bin/codacycoverage clover tst/log/coverage-clover.xml - -cache: - directories: - - $HOME/.composer/cache/files - - $HOME/.composer/cache/vcs - - $HOME/.nvm - - $HOME/.npm - - js/node_modules