Skip to content

Commit

Permalink
Merge pull request #45 from igorhrcek/issue-7
Browse files Browse the repository at this point in the history
Issue 7
  • Loading branch information
igorhrcek authored Apr 12, 2022
2 parents 2c134df + 808b561 commit 74176b9
Show file tree
Hide file tree
Showing 18 changed files with 280 additions and 5,223 deletions.
4 changes: 4 additions & 0 deletions .env.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
WORDPRESS_NGINX_PATH=../wordpress
WORDPRESS_NGINX_URL=http://localhost:8080
WORDPRESS_APACHE_PATH=../wordpress
WORDPRESS_APACHE_URL=http://localhost:8080
55 changes: 55 additions & 0 deletions .github/workflows/apache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Apache tests
on:
pull_request:
branches:
- master
jobs:
tests:
runs-on: 'ubuntu-latest'
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: "rootpass"
MYSQL_USER: "wordpress"
MYSQL_PASSWORD: "wordpress"
MYSQL_DATABASE: "wordpress"
ports:
- 3306:3306
options: >-
--mount type=tmpfs,destination=/var/lib/mysql
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 3
wordpress:
image: ghcr.io/igorhrcek/wordpress-docker-apache/wordpress-docker-apache:latest
env:
WORDPRESS_DB_HOST: mysql
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
ports:
- 8080:80
options:
--name wordpress -v ${{ github.workspace }}/wordpress:/var/www/html
steps:
- uses: actions/checkout@v2
with:
path: 'codebase'

- name: Install dependencies
run: |
cd ${{ github.workspace }}/codebase && composer install && composer dump-autoload
- name: Copy .env files
run: |
cp -rf ${{ github.workspace }}/codebase/.env.ci ${{ github.workspace }}/codebase/.env
- name: Make .htaccess and nginx.conf writebable
run: |
sudo chown -R $USER:$USER ${{ github.workspace }}/wordpress
- name: Run PHPUnit tests
run: |
cd ${{ github.workspace }}/codebase && vendor/bin/phpunit --testdox --filter SecurityRulesApacheTest
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint
on:
pull_request:
branches:
- master
jobs:
lint:
runs-on: 'ubuntu-latest'
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer,phpstan, phpcs
- name: Install composer packages
run: |
composer update
composer install
- name: Lint and run checks with phpstan
run: phpstan analyse src --level=5
- name: Check codestyle with phpcs
run: phpcs src
Loading

0 comments on commit 74176b9

Please sign in to comment.