diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..72757d3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + phpunit: + name: PHPUnit (PHP ${{ matrix.php-version }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php-version: + - '8.1' + - '8.2' + - '8.3' + - '8.4' + - '8.5' + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Setup PHP + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2 + with: + php-version: ${{ matrix.php-version }} + extensions: curl, json, mbstring + coverage: none + + - name: Validate composer.json + run: composer validate --strict + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run PHPUnit + run: vendor/bin/phpunit diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 707be2a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: php -# Jammy Jellyfish environment has preinstalled PHP 8.1 -# Focal Fossa doesn't fit since it contains preinstalled PHP 7.4 only -# https://docs.travis-ci.com/user/reference/jammy/#php-support -dist: jammy -os: - - linux -php: - - 8.1 - - 8.2 -before_install: "composer install" -script: "vendor/bin/phpunit"