Skip to content

Commit 152dff4

Browse files
shahrukh-compucoMuhammad Shahrukh
authored and
Muhammad Shahrukh
committed
Merge pull request #1 from compucorp/dtab-83-first-commit
DTAB-83: Add Initial Files
2 parents 70526d4 + 856e624 commit 152dff4

24 files changed

+1341
-0
lines changed

.github/workflows/linters.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Linters
2+
3+
on: pull_request
4+
5+
env:
6+
GITHUB_BASE_REF: ${{ github.base_ref }}
7+
8+
jobs:
9+
run-linters:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Install phpcs
17+
run: cd bin && ./install-php-linter
18+
19+
- name: Fetch target branch
20+
run: git fetch -n origin ${GITHUB_BASE_REF}
21+
22+
- name: Run phpcs linter
23+
run: git diff --diff-filter=d origin/${GITHUB_BASE_REF} --name-only -- '*.php' | xargs -r ./bin/phpcs.phar --standard=phpcs-ruleset.xml

.github/workflows/phpstan.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Phpstan
2+
3+
on: pull_request
4+
5+
jobs:
6+
run-phpstan:
7+
8+
runs-on: ubuntu-latest
9+
container: compucorp/civicrm-buildkit:1.3.1-php8.0
10+
11+
env:
12+
CIVICRM_EXTENSIONS_DIR: site/web/sites/all/modules/civicrm/tools/extensions
13+
CIVICRM_SETTINGS_DIR: site/web/sites/default
14+
15+
services:
16+
mysql:
17+
image: mysql:5.7
18+
env:
19+
MYSQL_ROOT_PASSWORD: root
20+
ports:
21+
- 3306
22+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
23+
24+
steps:
25+
- name: Config mysql database as per CiviCRM requirement
26+
run: echo "SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));" | mysql -u root --password=root --host=mysql
27+
28+
- name: Install missing extension
29+
run: sudo apt update && apt install -y php-bcmath
30+
31+
- name: Config amp
32+
run: amp config:set --mysql_dsn=mysql://root:root@mysql:3306
33+
34+
- name: Build Drupal site
35+
run: civibuild create drupal-clean --civi-ver 5.75.0 --cms-ver 7.103 --web-root $GITHUB_WORKSPACE/site
36+
37+
- uses: compucorp/[email protected]
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
with:
41+
repo: compucorp/civicrm-core
42+
version: 5.75.0
43+
path: site/web/sites/all/modules/civicrm
44+
45+
- uses: actions/checkout@v2
46+
with:
47+
path: ${{ env.CIVICRM_EXTENSIONS_DIR }}/thinkific
48+
49+
- name: Run phpstan
50+
working-directory: ${{ env.CIVICRM_EXTENSIONS_DIR }}/thinkific
51+
run: ./bin/phpstan.phar analyse -c phpstan.neon

.github/workflows/tests.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Tests
2+
3+
on: pull_request
4+
5+
jobs:
6+
run-unit-tests:
7+
8+
runs-on: ubuntu-latest
9+
container: compucorp/civicrm-buildkit:1.3.1-php8.0
10+
11+
env:
12+
CIVICRM_EXTENSIONS_DIR: site/web/sites/all/modules/civicrm/tools/extensions
13+
CIVICRM_SETTINGS_DIR: site/web/sites/default
14+
15+
services:
16+
mysql:
17+
image: mysql:5.7
18+
env:
19+
MYSQL_ROOT_PASSWORD: root
20+
ports:
21+
- 3306
22+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
23+
24+
steps:
25+
- name: Config mysql database as per CiviCRM requirement
26+
run: echo "SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));" | mysql -u root --password=root --host=mysql
27+
28+
- name: Composer version downgrade 2.2.5
29+
run: composer self-update 2.2.5
30+
31+
- name: Install missing extension
32+
run: sudo apt update && apt install -y php-bcmath
33+
34+
- name: Config amp
35+
run : amp config:set --mysql_dsn=mysql://root:root@mysql:3306
36+
37+
- name: Build Drupal site
38+
run: civibuild create drupal-clean --civi-ver 5.75.0 --cms-ver 7.103 --web-root $GITHUB_WORKSPACE/site
39+
40+
- uses: compucorp/[email protected]
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
with:
44+
repo: compucorp/civicrm-core
45+
version: 5.75.0
46+
path: site/web/sites/all/modules/civicrm
47+
48+
- uses: actions/checkout@v2
49+
with:
50+
path: ${{ env.CIVICRM_EXTENSIONS_DIR }}/thinkific
51+
52+
- name: Enable Thinkific extension
53+
working-directory: ${{ env.CIVICRM_EXTENSIONS_DIR }}
54+
run: |
55+
cv en thinkific
56+
57+
- name: Run phpunit tests
58+
working-directory: ${{ env.CIVICRM_EXTENSIONS_DIR }}/thinkific
59+
run: phpunit9

CRM/Thinkific/.gitkeep

Whitespace-only changes.

Civi/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)