Skip to content

Commit

Permalink
Merge pull request #1423 from xwp/fix/dev-env
Browse files Browse the repository at this point in the history
Update tooling and automations
  • Loading branch information
delawski authored Jul 17, 2024
2 parents cf03e51 + 530a355 commit b293e23
Show file tree
Hide file tree
Showing 65 changed files with 4,865 additions and 4,128 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ jobs:
lint:
name: Lint and Test
runs-on: ubuntu-22.04
permissions:
contents: read
packages: read
steps:

- name: Checkout
Expand All @@ -24,6 +27,24 @@ jobs:
php-version: '8.1'
tools: composer:v2

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer packages
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ hashFiles( 'composer.lock' ) }}
restore-keys: ${{ runner.os }}-php-

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install NPM dependencies
run: npm install

Expand All @@ -33,11 +54,11 @@ jobs:
- name: Lint
run: npm run lint

- name: Pull Docker Images
run: docker-compose pull wordpress
- name: Pull custom Docker images
run: docker compose pull wordpress

- name: Test PHP
run: npm run phpunit
- name: Test
run: npm run test

- name: Build
run: npm run build
40 changes: 40 additions & 0 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and Publish Docker Images

on:
push:
paths:
- '.github/workflows/**'
- 'docker-compose.yml'
- 'docker-compose.build.yml'
- 'local/docker/**'

jobs:

build-and-push-image:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build images
run: docker compose --file docker-compose.build.yml build

- name: Publish images
if: contains( github.ref_name, 'master' )
run: docker buildx bake --file docker-compose.build.yml --push --set '*.platform=linux/amd64,linux/arm64'
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
/vendor/
/build/
/dist/
/.vagrant/
/console.log
/phpcs.xml
/stream.zip
/stream-*.zip
npm-debug.log
package.lock
.phpunit.result.cache

# Compiled files
ui/js/*.min.js
Expand Down
93 changes: 0 additions & 93 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"name": "Listen for Stream XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"port": 9003,
"ignore": [
"vendor/"
],
"pathMappings": {
"/var/www/html/wp-content/plugins/stream-src": "${workspaceRoot}",
"/var/www/html/wp-content/plugins/stream": "${workspaceRoot}/build",
"/var/www/html": "${workspaceRoot}/local/public"
"/var/www/html/wp-content/plugins/stream-src": "${workspaceFolder}",
"/var/www/html/wp-content/plugins/stream": "${workspaceFolder}/build",
"/var/www/html": "${workspaceFolder}/local/public"
}
}
]
Expand Down
13 changes: 0 additions & 13 deletions Vagrantfile

This file was deleted.

20 changes: 12 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
}
],
"require": {
"php": ">=5.6.20",
"composer/installers": "~1.0"
},
"require-dev": {
Expand All @@ -21,16 +22,18 @@
"php-coveralls/php-coveralls": "^2.5",
"phpcompatibility/php-compatibility": "dev-develop as 9.99.99",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpunit/phpunit": "^5.7",
"phpunit/phpunit": "^9.6",
"roots/wordpress": "^6.2",
"wp-cli/wp-cli-bundle": "^2.6",
"wp-coding-standards/wpcs": "^2.3",
"wp-phpunit/wp-phpunit": "^6.3",
"wpackagist-plugin/advanced-custom-fields": "5.8.12",
"wpackagist-plugin/easy-digital-downloads": "2.9.23",
"wpackagist-plugin/jetpack": "10.0",
"wpackagist-plugin/user-switching": "1.5.5",
"wpsh/local": "^0.2.3",
"yoast/phpunit-polyfills": "^1.0"
"wpackagist-theme/twentytwentythree": "^1.0",
"xwp/wait-for": "^0.0.1",
"yoast/phpunit-polyfills": "^1.1"
},
"config": {
"process-timeout": 600,
Expand All @@ -40,15 +43,16 @@
},
"allow-plugins": {
"composer/installers": true,
"johnpbloch/wordpress-core-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"roots/wordpress-core-installer": true
}
},
"extra": {
"wordpress-install-dir": "local/public",
"wordpress-install-dir": "local/public/wp",
"installer-paths": {
"local/public/wp-content/plugins/{$name}/": ["type:wordpress-plugin"],
"local/public/wp-content/mu-plugins/{$name}/": ["type:wordpress-muplugin"]
"local/public/wp-content/themes/{$name}": ["type:wordpress-theme"],
"local/public/wp-content/plugins/{$name}": ["type:wordpress-plugin"],
"local/public/wp-content/mu-plugins/{$name}": ["type:wordpress-muplugin"]
}
},
"scripts": {
Expand Down
Loading

0 comments on commit b293e23

Please sign in to comment.