Skip to content

Commit 785add2

Browse files
authored
chore: Merge pull request #276 from WebFiori/dev
ci: Updated Workflows
2 parents 21b650e + dfc5808 commit 785add2

152 files changed

Lines changed: 9126 additions & 9273 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/FUNDING.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/php81.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
name: Build PHP 8.1
1+
name: PHP 8.1
22

33
on:
44
push:
55
branches: [ main ]
66
pull_request:
77
branches: [ main ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
813
jobs:
914
test:
1015
runs-on: ubuntu-latest
@@ -104,7 +109,7 @@ jobs:
104109
code-coverage:
105110
name: Coverage
106111
needs: test
107-
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main
112+
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@v1.2.1
108113
with:
109114
php-version: '8.1'
110115
coverage-file: 'php-8.1-coverage.xml'

.github/workflows/php82.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
name: Build PHP 8.2
1+
name: PHP 8.2
22

33
on:
44
push:
55
branches: [ main, dev ]
66
pull_request:
77
branches: [ main ]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
test:
1115
runs-on: ubuntu-latest
@@ -105,7 +109,7 @@ jobs:
105109
code-coverage:
106110
name: Coverage
107111
needs: test
108-
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main
112+
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@v1.2.1
109113
with:
110114
php-version: '8.2'
111115
coverage-file: 'php-8.2-coverage.xml'

.github/workflows/php83.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
name: Build PHP 8.3
1+
name: PHP 8.3
22

33
on:
44
push:
55
branches: [ main, dev ]
66
pull_request:
77
branches: [ main, dev ]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
test:
1115
runs-on: ubuntu-latest
@@ -105,7 +109,7 @@ jobs:
105109
code-coverage:
106110
name: Coverage
107111
needs: test
108-
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main
112+
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@v1.2.1
109113
with:
110114
php-version: '8.3'
111115
coverage-file: 'php-8.3-coverage.xml'

.github/workflows/php84.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
test:
1115
runs-on: ubuntu-latest
@@ -106,23 +110,9 @@ jobs:
106110
code-coverage:
107111
name: Coverage
108112
needs: test
109-
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main
113+
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@v1.2.1
110114
with:
111115
php-version: '8.4'
112116
coverage-file: 'php-8.4-coverage.xml'
113117
secrets:
114118
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
115-
116-
code-quality:
117-
name: Code Quality
118-
needs: test
119-
uses: WebFiori/workflows/.github/workflows/quality-sonarcloud.yaml@main
120-
secrets:
121-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
122-
123-
release-prod:
124-
name: Prepare Production Release Branch / Publish Release
125-
needs: [code-coverage, code-quality]
126-
uses: WebFiori/workflows/.github/workflows/release-php.yaml@main
127-
with:
128-
branch: 'main'

.github/workflows/php85.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: PHP 8.5
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 10
17+
18+
env:
19+
SA_SQL_SERVER_PASSWORD: ${{ secrets.SA_SQL_SERVER_PASSWORD }}
20+
MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_ROOT_PASSWORD }}
21+
22+
services:
23+
sqlserver:
24+
image: mcr.microsoft.com/mssql/server:2019-latest
25+
env:
26+
SA_PASSWORD: ${{ secrets.SA_SQL_SERVER_PASSWORD }}
27+
ACCEPT_EULA: Y
28+
MSSQL_PID: Express
29+
ports:
30+
- "1433:1433"
31+
mysql:
32+
image: mysql:8.0
33+
env:
34+
MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_ROOT_PASSWORD }}
35+
MYSQL_DATABASE: testing_db
36+
MYSQL_ROOT_HOST: '%'
37+
ports:
38+
- 3306:3306
39+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
40+
strategy:
41+
fail-fast: true
42+
43+
name: Run PHPUnit Tests
44+
45+
steps:
46+
- name: Clone Repo
47+
uses: actions/checkout@v4
48+
49+
- name: Setup PHP
50+
uses: shivammathur/setup-php@v2
51+
with:
52+
php-version: 8.5
53+
extensions: mysqli, mbstring, sqlsrv
54+
tools: phpunit:12.5.4, composer
55+
56+
- name: Install ODBC Driver for SQL Server
57+
run: |
58+
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
59+
curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
60+
sudo apt update
61+
sudo ACCEPT_EULA=Y apt install mssql-tools18 unixodbc-dev msodbcsql18
62+
63+
- name: Wait for SQL Server
64+
run: |
65+
for i in {1..12}; do
66+
if /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P '${{ secrets.SA_SQL_SERVER_PASSWORD }}' -Q 'SELECT 1' -C > /dev/null 2>&1; then
67+
echo "SQL Server is ready"
68+
break
69+
fi
70+
echo "Waiting for SQL Server... ($i/12)"
71+
sleep 10
72+
done
73+
74+
- name: Create SQL Server Database
75+
run: /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P '${{ secrets.SA_SQL_SERVER_PASSWORD }}' -Q 'create database testing_db' -C
76+
77+
- name: Setup MySQL Client
78+
run: |
79+
sudo apt update
80+
sudo apt install mysql-client-core-8.0
81+
82+
- name: Wait for MySQL
83+
run: |
84+
until mysqladmin ping -h 127.0.0.1 --silent; do
85+
echo 'waiting for mysql...'
86+
sleep 1
87+
done
88+
89+
- name: Create MySQL Database
90+
run: |
91+
mysql -h 127.0.0.1 -u root -p${{ secrets.MYSQL_ROOT_PASSWORD }} -e "CREATE DATABASE IF NOT EXISTS testing_db;"
92+
93+
- name: Install Dependencies
94+
run: composer install --prefer-source --no-interaction
95+
96+
- name: Execute Tests
97+
run: phpunit --configuration=tests/phpunit10.xml --coverage-clover=clover.xml
98+
99+
- name: Rename coverage report
100+
run: |
101+
mv clover.xml php-8.5-coverage.xml
102+
103+
- name: Upload Coverage Report
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: code-coverage
107+
path: php-8.5-coverage.xml
108+
109+
110+
code-coverage:
111+
name: Coverage
112+
needs: test
113+
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@v1.2.1
114+
with:
115+
php-version: '8.5'
116+
coverage-file: 'php-8.5-coverage.xml'
117+
secrets:
118+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
119+
120+
code-quality:
121+
name: Code Quality
122+
needs: test
123+
uses: WebFiori/workflows/.github/workflows/quality-sonarcloud.yaml@v1.2.1
124+
secrets:
125+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
126+
127+
release-prod:
128+
name: Prepare Production Release Branch / Publish Release
129+
needs: [code-coverage, code-quality]
130+
uses: WebFiori/workflows/.github/workflows/release-php.yaml@v1.2.1
131+
with:
132+
branch: 'main'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ App/Config/*
1616
*.Identifier
1717
tests/clover.xml
1818
/.vscode
19+
/App

App/Config/config-with-env.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"base-url":"DYNAMIC",
3+
"theme":null,
4+
"home-page":"BASE_URL",
5+
"primary-lang":"env:LANG",
6+
"titles":{
7+
"AR":"افتراضي",
8+
"EN":"Default"
9+
},
10+
"name-separator":"|",
11+
"scheduler-password":"env:SCHEDULER_PASS",
12+
"app-names":{
13+
"AR":"تطبيق",
14+
"EN":"Application"
15+
},
16+
"app-descriptions":{
17+
"AR":"",
18+
"EN":""
19+
},
20+
"version-info":{
21+
"version":"1.0",
22+
"version-type":"Stable",
23+
"release-date":"2023-10-30"
24+
},
25+
"env-vars":{
26+
"WF_VERBOSE_2":{
27+
"value":"env:VERBOSE",
28+
"description":"Configure the verbosity of error messsages at run-time. This should be set to true in testing and false in production."
29+
},
30+
"CLI_HTTP_HOST_2":{
31+
"value":"example.com",
32+
"description":"Host name that will be used when runing the application as command line utility."
33+
},
34+
"HOST":"env:HOST"
35+
},
36+
"smtp-connections":{
37+
"conn00": {
38+
"host":"smtp.outlook.com",
39+
"port":"244",
40+
"username":"env:SMTP_00_USER",
41+
"password":"env:SMTP_00_PASS",
42+
"address":"env:SMTP_00_ADDRESS",
43+
"sender-name":"env:SMTP_00_NAME",
44+
"access-token":"env:SMTP_TOKEN"
45+
}
46+
},
47+
"database-connections":{
48+
"New_Connection":{
49+
"type":"mysql",
50+
"host":"env:DB_HOST_1",
51+
"port":3306,
52+
"username":"cool",
53+
"database":"env:DB_NAME_1",
54+
"password":"env:DB_PASS_1",
55+
"extras":{
56+
}
57+
},
58+
"New_Connection_2":{
59+
"type":"mysql",
60+
"host":"env:DB_HOST_2",
61+
"port":3306,
62+
"database":"env:DB_NAME_2",
63+
"password":"env:DB_PASS_2",
64+
"username":"cool",
65+
"extras":{
66+
}
67+
}
68+
}
69+
}

0 commit comments

Comments
 (0)