Skip to content

Commit ab671f0

Browse files
committed
Revert "comment out"
This reverts commit 2246e49.
1 parent 2e2cd31 commit ab671f0

File tree

3 files changed

+236
-236
lines changed

3 files changed

+236
-236
lines changed

.github/workflows/ci.yml

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,78 @@
1-
#name: phpList Core Build
2-
#on: [push, pull_request]
3-
#jobs:
4-
# main:
5-
# name: phpList on PHP ${{ matrix.php-versions }} [Build, Test]
6-
# runs-on: ubuntu-22.04
7-
# env:
8-
# DB_DATABASE: phplist
9-
# DB_USERNAME: root
10-
# DB_PASSWORD: phplist
11-
# BROADCAST_DRIVER: log
12-
# services:
13-
# mysql:
14-
# image: mysql:5.7
15-
# env:
16-
# MYSQL_ALLOW_EMPTY_PASSWORD: false
17-
# MYSQL_ROOT_PASSWORD: ${{ env.DB_PASSWORD }}
18-
# MYSQL_DATABASE: ${{ env.DB_DATABASE }}
19-
# ports:
20-
# - 3306/tcp
21-
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
22-
# strategy:
23-
# fail-fast: false
24-
# matrix:
25-
# php-versions: ['8.1']
26-
# steps:
27-
# - name: Checkout
28-
# uses: actions/checkout@v3
29-
# - name: Setup PHP, with composer and extensions
30-
# uses: shivammathur/setup-php@v2
31-
# with:
32-
# php-version: ${{ matrix.php-versions }}
33-
# extensions: mbstring, dom, fileinfo, mysql
34-
# coverage: xdebug #optional
35-
# - name: Install Symfony CLI
36-
# run: |
37-
# curl -sS https://get.symfony.com/cli/installer | bash
38-
# mv $HOME/.symfony*/bin/symfony /usr/local/bin/symfony
39-
# symfony version
40-
# - name: Start mysql service
41-
# run: sudo /etc/init.d/mysql start
42-
# - name: Verify MySQL connection on host
43-
# run: mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports['3306'] }} -u${{ env.DB_USERNAME }} -p${{ env.DB_PASSWORD }} -e "SHOW DATABASES"
44-
# - name: Set up database schema
45-
# run: mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports['3306'] }} -u${{ env.DB_USERNAME }} -p${{ env.DB_PASSWORD }} ${{ env.DB_DATABASE }} < resources/Database/Schema.sql
46-
# - name: Get composer cache directory
47-
# id: composer-cache
48-
# run: echo "::set-output name=dir::$(composer config cache-files-dir)"
49-
# - name: Cache composer dependencies
50-
# uses: actions/cache@v3
51-
# with:
52-
# path: ${{ steps.composer-cache.outputs.dir }}
53-
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
54-
# restore-keys: ${{ runner.os }}-composer-
55-
# - name: Install Composer dependencies
56-
# run: composer install --no-progress --prefer-dist --optimize-autoloader
57-
# - name: Validating composer.json
58-
# run: composer validate --no-check-all --no-check-lock --strict;
59-
# - name: Linting all php files
60-
# run: find src/ tests/ public/ -name ''*.php'' -print0 | xargs -0 -n 1 -P 4 php -l; php -l bin/*;
61-
# - name: Run units tests with phpunit
62-
# run: vendor/bin/phpunit tests/Unit/ --testdox
63-
# - name: Run integration tests with phpunit
64-
# run: |
65-
# export PHPLIST_DATABASE_NAME=${{ env.DB_DATABASE }}
66-
# export PHPLIST_DATABASE_USER=${{ env.DB_USERNAME }}
67-
# export PHPLIST_DATABASE_PASSWORD=${{ env.DB_PASSWORD }}
68-
# export PHPLIST_DATABASE_PORT=${{ job.services.mysql.ports['3306'] }}
69-
# export PHPLIST_DATABASE_HOST=127.0.0.1
70-
# vendor/bin/phpunit tests/Integration/
71-
# - name: Running the system tests
72-
# run: vendor/bin/phpunit tests/System/ --testdox;
73-
# - name: Running static analysis
74-
# run: vendor/bin/phpstan analyse -c phpstan.neon;
75-
# - name: Running PHPMD
76-
# run: vendor/bin/phpmd src/ text config/PHPMD/rules.xml;
77-
# - name: Running PHP_CodeSniffer
78-
# run: vendor/bin/phpcs --standard=config/PhpCodeSniffer/ bin/ src/ tests/ public/;
1+
name: phpList Core Build
2+
on: [push, pull_request]
3+
jobs:
4+
main:
5+
name: phpList on PHP ${{ matrix.php-versions }} [Build, Test]
6+
runs-on: ubuntu-22.04
7+
env:
8+
DB_DATABASE: phplist
9+
DB_USERNAME: root
10+
DB_PASSWORD: phplist
11+
BROADCAST_DRIVER: log
12+
services:
13+
mysql:
14+
image: mysql:5.7
15+
env:
16+
MYSQL_ALLOW_EMPTY_PASSWORD: false
17+
MYSQL_ROOT_PASSWORD: ${{ env.DB_PASSWORD }}
18+
MYSQL_DATABASE: ${{ env.DB_DATABASE }}
19+
ports:
20+
- 3306/tcp
21+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
php-versions: ['8.1']
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
- name: Setup PHP, with composer and extensions
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: ${{ matrix.php-versions }}
33+
extensions: mbstring, dom, fileinfo, mysql
34+
coverage: xdebug #optional
35+
- name: Install Symfony CLI
36+
run: |
37+
curl -sS https://get.symfony.com/cli/installer | bash
38+
mv $HOME/.symfony*/bin/symfony /usr/local/bin/symfony
39+
symfony version
40+
- name: Start mysql service
41+
run: sudo /etc/init.d/mysql start
42+
- name: Verify MySQL connection on host
43+
run: mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports['3306'] }} -u${{ env.DB_USERNAME }} -p${{ env.DB_PASSWORD }} -e "SHOW DATABASES"
44+
- name: Set up database schema
45+
run: mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports['3306'] }} -u${{ env.DB_USERNAME }} -p${{ env.DB_PASSWORD }} ${{ env.DB_DATABASE }} < resources/Database/Schema.sql
46+
- name: Get composer cache directory
47+
id: composer-cache
48+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
49+
- name: Cache composer dependencies
50+
uses: actions/cache@v3
51+
with:
52+
path: ${{ steps.composer-cache.outputs.dir }}
53+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
54+
restore-keys: ${{ runner.os }}-composer-
55+
- name: Install Composer dependencies
56+
run: composer install --no-progress --prefer-dist --optimize-autoloader
57+
- name: Validating composer.json
58+
run: composer validate --no-check-all --no-check-lock --strict;
59+
- name: Linting all php files
60+
run: find src/ tests/ public/ -name ''*.php'' -print0 | xargs -0 -n 1 -P 4 php -l; php -l bin/*;
61+
- name: Run units tests with phpunit
62+
run: vendor/bin/phpunit tests/Unit/ --testdox
63+
- name: Run integration tests with phpunit
64+
run: |
65+
export PHPLIST_DATABASE_NAME=${{ env.DB_DATABASE }}
66+
export PHPLIST_DATABASE_USER=${{ env.DB_USERNAME }}
67+
export PHPLIST_DATABASE_PASSWORD=${{ env.DB_PASSWORD }}
68+
export PHPLIST_DATABASE_PORT=${{ job.services.mysql.ports['3306'] }}
69+
export PHPLIST_DATABASE_HOST=127.0.0.1
70+
vendor/bin/phpunit tests/Integration/
71+
- name: Running the system tests
72+
run: vendor/bin/phpunit tests/System/ --testdox;
73+
- name: Running static analysis
74+
run: vendor/bin/phpstan analyse -c phpstan.neon;
75+
- name: Running PHPMD
76+
run: vendor/bin/phpmd src/ text config/PHPMD/rules.xml;
77+
- name: Running PHP_CodeSniffer
78+
run: vendor/bin/phpcs --standard=config/PhpCodeSniffer/ bin/ src/ tests/ public/;

.github/workflows/core-docs.yml

Lines changed: 89 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,89 @@
1-
#name: Publish Core Docs
2-
#on: [push, pull_request]
3-
#jobs:
4-
# make-restapi-docs:
5-
# name: Checkout phpList core and generate docs using `phpDocumentor`
6-
# runs-on: ubuntu-22.04
7-
# steps:
8-
# - name: Checkout
9-
# uses: actions/checkout@v3
10-
# - name: Setup PHP, with composer and extensions
11-
# uses: shivammathur/setup-php@v2
12-
# with:
13-
# php-version: 8.1
14-
# extensions: mbstring, dom, fileinfo, mysql
15-
# - name: Get composer cache directory
16-
# id: composer-cache
17-
# run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_ENV
18-
# - name: Cache composer dependencies
19-
# uses: actions/cache@v3
20-
# with:
21-
# path: ${{ env.dir }}
22-
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
23-
# restore-keys: ${{ runner.os }}-composer-
24-
# - name: Install current dependencies from composer.lock
25-
# run: composer install
26-
# - name: Install phpDocumentor
27-
# run: |
28-
# wget https://phpdoc.org/phpDocumentor.phar
29-
# chmod +x phpDocumentor.phar
30-
# mv phpDocumentor.phar /usr/local/bin/phpDocumentor
31-
# - name: Verify phpDocumentor version
32-
# run: phpDocumentor --version
33-
# - name: Generate documentation
34-
# run: composer run-php-documentor
35-
# - name: Zip phpDocumentor directory
36-
# run: zip -r phpdocumentor.zip docs/phpdocumentor
37-
# - name: Upload generated doc files
38-
# uses: actions/upload-artifact@v4
39-
# with:
40-
# name: doc-files
41-
# path: phpdocumentor.zip
42-
# deploy-docs:
43-
# name: Deploy Core Docs
44-
# runs-on: ubuntu-22.04
45-
# needs: make-restapi-docs
46-
# steps:
47-
# - name: Checkout phplist/core-docs
48-
# uses: actions/checkout@v3
49-
# with:
50-
# repository: phpList/core-docs
51-
# fetch-depth: 0
52-
# token: ${{ secrets.PUSH_CORE_DOCS }}
53-
# - name: Restore REST API Spec
54-
# uses: actions/download-artifact@v4
55-
# with:
56-
# name: doc-files
57-
# - name: Unzip phpDocumentor
58-
# run: |
59-
# unzip phpdocumentor.zip
60-
# rm phpdocumentor.zip
61-
# - name: List Files
62-
# run: ls
63-
# - name: Sync old files with newly generated ones
64-
# run: rsync -av docs/phpdocumentor/* .
65-
# - name: Remove temporary directories
66-
# run: rm -rf docs
67-
# - name: Check if updates/changes
68-
# run: git status --porcelain > repo-changes.txt
69-
# - name: Check changes file
70-
# run: cat repo-changes.txt
71-
# - name: Verify updates
72-
# id: allow-deploy
73-
# run: |
74-
# if [ -s repo-changes.txt ]; then
75-
# echo "Updates made to documentation";
76-
# echo 'DEPLOY=true' >> $GITHUB_ENV;
77-
# else
78-
# echo "No updates made to documentation. Deployment would be skipped.";
79-
# echo 'DEPLOY=false' >> $GITHUB_ENV;
80-
# fi
81-
# - name: Commit changes and deploy
82-
# if: ${{ env.DEPLOY == 'true' }}
83-
# run: |
84-
# rm repo-changes.txt
85-
# git config user.name "github-actions"
86-
# git config user.email "[email protected]"
87-
# git add .
88-
# git commit -s -m "phplist/core docs deployment `date`"
89-
# git push origin main --force
1+
name: Publish Core Docs
2+
on: [push, pull_request]
3+
jobs:
4+
make-restapi-docs:
5+
name: Checkout phpList core and generate docs using `phpDocumentor`
6+
runs-on: ubuntu-22.04
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v3
10+
- name: Setup PHP, with composer and extensions
11+
uses: shivammathur/setup-php@v2
12+
with:
13+
php-version: 8.1
14+
extensions: mbstring, dom, fileinfo, mysql
15+
- name: Get composer cache directory
16+
id: composer-cache
17+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_ENV
18+
- name: Cache composer dependencies
19+
uses: actions/cache@v3
20+
with:
21+
path: ${{ env.dir }}
22+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
23+
restore-keys: ${{ runner.os }}-composer-
24+
- name: Install current dependencies from composer.lock
25+
run: composer install
26+
- name: Install phpDocumentor
27+
run: |
28+
wget https://phpdoc.org/phpDocumentor.phar
29+
chmod +x phpDocumentor.phar
30+
mv phpDocumentor.phar /usr/local/bin/phpDocumentor
31+
- name: Verify phpDocumentor version
32+
run: phpDocumentor --version
33+
- name: Generate documentation
34+
run: composer run-php-documentor
35+
- name: Zip phpDocumentor directory
36+
run: zip -r phpdocumentor.zip docs/phpdocumentor
37+
- name: Upload generated doc files
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: doc-files
41+
path: phpdocumentor.zip
42+
deploy-docs:
43+
name: Deploy Core Docs
44+
runs-on: ubuntu-22.04
45+
needs: make-restapi-docs
46+
steps:
47+
- name: Checkout phplist/core-docs
48+
uses: actions/checkout@v3
49+
with:
50+
repository: phpList/core-docs
51+
fetch-depth: 0
52+
token: ${{ secrets.PUSH_CORE_DOCS }}
53+
- name: Restore REST API Spec
54+
uses: actions/download-artifact@v4
55+
with:
56+
name: doc-files
57+
- name: Unzip phpDocumentor
58+
run: |
59+
unzip phpdocumentor.zip
60+
rm phpdocumentor.zip
61+
- name: List Files
62+
run: ls
63+
- name: Sync old files with newly generated ones
64+
run: rsync -av docs/phpdocumentor/* .
65+
- name: Remove temporary directories
66+
run: rm -rf docs
67+
- name: Check if updates/changes
68+
run: git status --porcelain > repo-changes.txt
69+
- name: Check changes file
70+
run: cat repo-changes.txt
71+
- name: Verify updates
72+
id: allow-deploy
73+
run: |
74+
if [ -s repo-changes.txt ]; then
75+
echo "Updates made to documentation";
76+
echo 'DEPLOY=true' >> $GITHUB_ENV;
77+
else
78+
echo "No updates made to documentation. Deployment would be skipped.";
79+
echo 'DEPLOY=false' >> $GITHUB_ENV;
80+
fi
81+
- name: Commit changes and deploy
82+
if: ${{ env.DEPLOY == 'true' }}
83+
run: |
84+
rm repo-changes.txt
85+
git config user.name "github-actions"
86+
git config user.email "[email protected]"
87+
git add .
88+
git commit -s -m "phplist/core docs deployment `date`"
89+
git push origin main --force

0 commit comments

Comments
 (0)