Skip to content

Commit b1f4c57

Browse files
authored
Php laravel ci automation (#128)
This PR introduces a basic CI workflow for PHP SQLCommenter. The workflow is as follows: 1. On creating a PR on PHP SQLCommenter Laravel library code, we will run integration and unit tests. 2. After a PHP SQLCommenter Laravel library code PR is merged, we push the library code into `sqlcommenter-php` repository
1 parent 9018255 commit b1f4c57

3 files changed

Lines changed: 33 additions & 5 deletions

File tree

.github/workflows/laravel-integration-tests.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1+
name: Laravel Integration Tests
12
on:
23
push:
34
branches:
45
- master
56
paths:
67
- php/sqlcommenter-php/packages/sqlcommenter-laravel/**
78
- php/sqlcommenter-php/samples/sqlcommenter-laravel/**
8-
9-
name: Laravel Integration Tests
9+
pull_request:
10+
paths:
11+
- php/sqlcommenter-php/packages/sqlcommenter-laravel/**
12+
- php/sqlcommenter-php/samples/sqlcommenter-laravel/**
1013
jobs:
11-
phpunit:
14+
run-integrationtests:
1215
runs-on: ubuntu-latest
1316
container:
1417
image: kirschbaumdevelopment/laravel-test-runner:8.0
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Publish to Sqlcommenter-php repository
2+
on:
3+
push:
4+
branches:
5+
- master
6+
paths:
7+
- php/sqlcommenter-php/packages/sqlcommenter-laravel/**
8+
jobs:
9+
push-to-repo:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Pushes to another repository
14+
uses: cpina/github-action-push-to-another-repository@main
15+
env:
16+
API_TOKEN_GITHUB: ${{ secrets.PHP_SQLCOMMENTER_PUSH_TOKEN }}
17+
with:
18+
source-directory: 'php/sqlcommenter-php/packages/sqlcommenter-laravel'
19+
destination-github-username: 'google'
20+
destination-repository-name: 'sqlcommenter-php'
21+
target-branch: master

.github/workflows/laravel-unit-tests.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
name: Laravel Unit Tests
12
on:
23
push:
34
branches:
45
- master
56
paths:
67
- php/sqlcommenter-php/packages/sqlcommenter-laravel/**
78
- php/sqlcommenter-php/samples/sqlcommenter-laravel/**
9+
pull_request:
10+
paths:
11+
- php/sqlcommenter-php/packages/sqlcommenter-laravel/**
12+
- php/sqlcommenter-php/samples/sqlcommenter-laravel/**
813

9-
name: Laravel Unit Tests
1014
jobs:
11-
phpunit:
15+
run-unittests:
1216
runs-on: ubuntu-latest
1317
container:
1418
image: kirschbaumdevelopment/laravel-test-runner:8.0

0 commit comments

Comments
 (0)