diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..250e66f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,62 @@ +name: Build + +on: + push: + branches: + - master + - dev + pull_request: + branches: + - '*' + schedule: + - cron: "0 7 2 * *" + branches: + - master + +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + extensions: gd, zip + coverage: xdebug + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install dependencies + run: composer install --prefer-dist + + - name: Run build + run: | + composer build + + - name: Run check + run: | + composer check + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + commit-message: "Update from script" + committer: GitHub + title: "Update from script" + body: "This is an automated pull request to update from script" + branch: build-${{ github.run_id }} diff --git a/.gitignore b/.gitignore index 3fec32c..3b726a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ tmp/ +vendor/ +composer.lock diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ef12827..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: php - -php: - - 7.2 - -dist: trusty -sudo: false - -cache: - directories: - - $HOME/.composer/cache - -matrix: - fast_finish: true - -install: - - composer install --prefer-dist --no-interaction - -before_script: - - composer build - -script: - - composer check - -notifications: - email: false