Skip to content

Commit

Permalink
add .github files
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed Nov 20, 2023
1 parent 9267b31 commit 7e4fb08
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -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
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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
66 changes: 66 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7e4fb08

Please sign in to comment.