Skip to content

Commit

Permalink
added gh actions scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
lewislarsen committed Jun 13, 2024
1 parent 9ca0860 commit 349d651
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 0 deletions.
29 changes: 29 additions & 0 deletions github/workflows/code-fixing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Fix code style

on:
push:
branches: [main]
pull_request:
branches: [main]
paths:
- '**.php'

jobs:
php-code-styling:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
token: ${{ secrets.PAT }}
ref: ${{ github.head_ref }}

- name: Fix PHP code style issues
uses: aglipanci/[email protected]

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Ensured code style consistency.
32 changes: 32 additions & 0 deletions github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Dependabot auto-merge
on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:

- name: Dependabot metadata
id: metadata
uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Auto-merge Dependabot PRs for semver-minor updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Auto-merge Dependabot PRs for semver-patch updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
47 changes: 47 additions & 0 deletions github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
phpunit:
runs-on: ubuntu-latest
container:
image: kirschbaumdevelopment/laravel-test-runner:8.3

services:
postgres:
image: postgres:15.1
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: vanguard
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Install composer dependencies
run: |
composer install --no-scripts
- name: Prepare Laravel Application
run: |
cp .env.example.ci .env
php artisan key:generate
- name: Install npm dependencies
run: npm install

- name: Build assets
run: npm run build

- name: Run Tests
run: vendor/bin/pest

0 comments on commit 349d651

Please sign in to comment.