From f2175860594d5dd99ac56cacdd619d9ec6472d04 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 9 Jul 2024 14:40:58 +0200 Subject: [PATCH] run tests using GitHub actions --- .github/workflows/unit-tests.yaml | 49 +++++++++++++++++++++++++++++++ .travis.yml | 28 ------------------ test/CommonMarkTestStrict.php | 4 ++- 3 files changed, 52 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/unit-tests.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml new file mode 100644 index 000000000..029e3d288 --- /dev/null +++ b/.github/workflows/unit-tests.yaml @@ -0,0 +1,49 @@ +on: + - push + - pull_request + +jobs: + phpunit: + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - php: '7.1' + composer: '2.2' + - php: '7.2' + composer: '2.2' + - php: '7.3' + composer: latest + - php: '7.4' + composer: latest + - php: '8.0' + composer: latest + - php: '8.1' + composer: latest + - php: '8.2' + composer: latest + - php: '8.3' + composer: latest + - php: '8.4' + composer: latest + + steps: + - name: Checkout the source code + uses: actions/checkout@v4 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '${{ matrix.php }}' + + - name: Install dependencies + uses: php-actions/composer@v6 + with: + php_version: '${{ matrix.php }}' + version: '${{ matrix.composer }}' + + - name: Run tests + run: | + vendor/bin/phpunit + vendor/bin/phpunit test/CommonMarkTestWeak.php || true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7a8ba35f3..000000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: php - -dist: trusty -sudo: false - -matrix: - include: - - php: 5.3 - dist: precise - - php: 5.4 - - php: 5.5 - - php: 5.6 - - php: 7.0 - - php: 7.1 - - php: 7.2 - - php: 7.3 - - php: nightly - fast_finish: true - allow_failures: - - php: nightly - -install: - - composer install --prefer-dist --no-interaction --no-progress - -script: - - vendor/bin/phpunit - - vendor/bin/phpunit test/CommonMarkTestWeak.php || true - - '[ -z "$TRAVIS_TAG" ] || [ "$TRAVIS_TAG" == "$(php -r "require(\"Parsedown.php\"); echo Parsedown::version;")" ]' diff --git a/test/CommonMarkTestStrict.php b/test/CommonMarkTestStrict.php index 3837738cb..9a007e234 100644 --- a/test/CommonMarkTestStrict.php +++ b/test/CommonMarkTestStrict.php @@ -1,11 +1,13 @@