Skip to content

Commit

Permalink
add github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
LouiseMcMahon committed Jan 28, 2025
1 parent 0b72032 commit f76501a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.4]
php: [8.3]

steps:
- name: Checkout code
Expand Down
31 changes: 4 additions & 27 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: php-actions/composer@v6
with:
php_extensions: zip pcntl mysqli bcmath soap intl gd exif imagick redis xdebug
php_version: "8.2"
php_version: "8.3"

- name: Upload application
uses: actions/upload-artifact@v4
Expand All @@ -37,11 +37,6 @@ jobs:
runs-on: ubuntu-latest
needs: setup
services:
redis:
image: redis
ports:
- 6379:6379
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
mysql:
image: mysql:latest
env:
Expand All @@ -62,7 +57,6 @@ jobs:
- name: Execute tests
uses: php-actions/composer@v6
env:
REDIS_PORT: 6379
DB_PORT: 3306
DB_CONNECTION: mysql
DB_DATABASE: hm_test
Expand All @@ -71,7 +65,7 @@ jobs:
XDEBUG_MODE: coverage
APP_KEY: ${{ secrets.TESTING_APP_KEY }}
with:
php_version: "8.2"
php_version: "8.3"
command: test
php_extensions: zip pcntl mysqli bcmath soap intl gd exif imagick redis xdebug
- name: Upload application
Expand All @@ -80,23 +74,6 @@ jobs:
name: coverage
path: coverage/all/cobertura.xml

run-stan:
runs-on: ubuntu-latest
needs: setup
strategy:
fail-fast: false
steps:
- name: Download application
uses: actions/download-artifact@v4
with:
name: app_files

- name: Check Stan
uses: php-actions/composer@v6
with:
php_version: "8.2"
command: stan

check-coverage:
runs-on: ubuntu-latest
needs: run-tests
Expand Down Expand Up @@ -158,7 +135,7 @@ jobs:
cleanup-artifacts-pr:
runs-on: ubuntu-latest
if: github.event.pull_request.number != null
needs: [setup, run-tests, run-stan, check-coverage, comment-coverage]
needs: [setup, run-tests, check-coverage, comment-coverage]
steps:
- uses: geekyeggo/delete-artifact@v5
with:
Expand All @@ -170,7 +147,7 @@ jobs:
cleanup-artifacts-branch:
runs-on: ubuntu-latest
if: github.event.pull_request.number == null
needs: [setup, run-tests, run-stan, check-coverage]
needs: [setup, run-tests, check-coverage]
steps:
- uses: geekyeggo/delete-artifact@v5
with:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/stan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Fix Code Style

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
stan:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.3]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, dom, curl, libxml, mbstring
coverage: none

- name: Install Stan
run: composer install --dev

- name: Run Stan
run: composer run stan

0 comments on commit f76501a

Please sign in to comment.