diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..0208e122 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,7 @@ +# These owners will be the default owners for everything in the repo. Unless a +# later match takes precedence, they will be requested for review when someone +# opens a pull request. +* @code4romania/php + +# More details on creating a codeowners file: +# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..93be2075 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,27 @@ +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + + # Maintain dependencies for Composer + - package-ecosystem: "composer" + directory: "/" + schedule: + interval: "monthly" + versioning-strategy: increase + # This option has no impact on security updates, which have a separate, + # internal limit of ten open pull requests. + open-pull-requests-limit: 0 + + # Maintain dependencies for npm + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "monthly" + versioning-strategy: increase + # This option has no impact on security updates, which have a separate, + # internal limit of ten open pull requests. + open-pull-requests-limit: 0 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..4c6df222 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,66 @@ +name: Tests + +on: [push] + +jobs: + test: + name: PHP ${{ matrix.php-version }} + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + php-version: + - "8.3" + + env: + extensions: mbstring, sqlite, intl, gd + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup cache environment + id: extcache + uses: shivammathur/cache-extensions@v1 + with: + php-version: ${{ matrix.php-version }} + extensions: ${{ env.extensions }} + key: php-extensions-cache + + - name: Cache extensions + uses: actions/cache@v3 + with: + path: ${{ steps.extcache.outputs.dir }} + key: ${{ steps.extcache.outputs.key }} + restore-keys: ${{ steps.extcache.outputs.key }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: ${{ env.extensions }} + coverage: pcov + tools: composer:v2 + + - name: Get composer cache directory + id: composercache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache composer dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composercache.outputs.dir }} + key: dependencies-composer-${{ hashFiles('composer.lock') }}-php-${{ matrix.php-version }} + restore-keys: dependencies-composer- + + - name: Install composer dependencies + run: composer install --prefer-dist --no-interaction + + - name: Setup env + run: | + cp .env.example .env + php artisan key:generate --ansi + + - name: Run tests + run: php artisan test