diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..351bab4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: [ main] + pull_request: + branches: [ main ] + +jobs: + tests: + name: Tests + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + env: + - AUTOLOAD=0 + - AUTOLOAD=1 + php-version: + - "7.4" + - "8.0" + - "8.1" + + steps: + - uses: actions/checkout@master + + - name: Setup PHP + uses: shivammathur/setup-php@master + with: + php-version: ${{ matrix.php-version }} + coverage: xdebug + + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }} + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest