-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: upgrade skeleton * fix: build process * fix: pipeline actions * fix: pb dependency * fix: use container * chore: cleanup * fix: update main script name Co-authored-by: Ned Zimmerman <[email protected]> * fix: typo Co-authored-by: Ned Zimmerman <[email protected]> * chore: update `.editorconfig` I've opted to use space indent style since we're using Laravel Pint. * fix: mixed spaces in `composer.json` * chore: remove `composer.lock` Since this is a scaffold, it would be better to not include this file * chore: remove `eslint` and `sass` * chore: remove coverage in standards check * chore: split code coverage steps * chore: remove phpcodesniffer * chore: set `pressbooks` as a dev dependency --------- Co-authored-by: Felipe Dalcin <[email protected]> Co-authored-by: Ned Zimmerman <[email protected]> Co-authored-by: Felipe Dalcin <[email protected]>
- Loading branch information
1 parent
c755707
commit af63e20
Showing
40 changed files
with
569 additions
and
18,926 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Check Standards | ||
|
||
on: | ||
push: | ||
branches: [dev, production] | ||
tags: | ||
- '*.*.*' | ||
pull_request: | ||
branches: [dev, production] | ||
|
||
jobs: | ||
src: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
php: [8.1] | ||
os: [ubuntu-20.04] | ||
|
||
name: Source code on PHP ${{ matrix.php }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache composer packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ matrix.php }}-php-${{ hashFiles('**/composer.lock') }} | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer | ||
coverage: none | ||
|
||
- name: Install dependencies | ||
env: | ||
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{secrets.PAT_FOR_GITHUB_ACTIONS}}"} }' | ||
run: | | ||
export PATH="$HOME/.composer/vendor/bin:$PATH" | ||
composer install --prefer-dist --no-interaction --no-progress | ||
- name: Execute style checking | ||
run: composer standards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [dev, production] | ||
tags: | ||
- '*.*.*' | ||
pull_request: | ||
branches: [dev, production] | ||
|
||
jobs: | ||
tests: | ||
runs-on: ${{ matrix.os }} | ||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [8.1, 8.2] | ||
os: [ubuntu-20.04] | ||
wordpress: [6.4.2, latest] | ||
include: | ||
- experimental: true | ||
- experimental: false | ||
php: 8.1 | ||
wordpress: 6.4.2 | ||
|
||
name: Tests - PHP ${{ matrix.php }} - WP ${{ matrix.wordpress }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Remove MySQL | ||
run: sudo apt remove mysql-server-8.0 mysql-common | ||
|
||
- name: Update apt | ||
run: sudo apt-get update | ||
|
||
- name: Install MariaDB | ||
run: | | ||
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 | ||
echo "deb http://downloads.mariadb.com/MariaDB/mariadb-10.5/repo/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/mariadb.list | ||
sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/mariadb.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" | ||
sudo apt-get install mariadb-server-10.5 mariadb-client-10.5 | ||
sudo mysqladmin -p'' password 'root' | ||
- name: Start required services | ||
run: sudo systemctl start mysql && mysql --version | ||
|
||
- name: Cache composer packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ matrix.php }}-php-${{ hashFiles('**/composer.lock') }} | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer | ||
coverage: pcov | ||
|
||
- name: Install dependencies | ||
env: | ||
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{secrets.PAT_FOR_GITHUB_ACTIONS}}"} }' | ||
run: composer install --no-interaction --no-progress | ||
|
||
- name: Install WP tests | ||
run: bash bin/install-wp-tests.sh wordpress_test root root localhost ${{ matrix.wordpress }} | ||
|
||
- name: Run tests | ||
run: composer test | ||
if: matrix.experimental == true | ||
|
||
- name: Run tests with coverage | ||
run: composer test-coverage | ||
if: matrix.experimental == false | ||
|
||
- name: Save code coverage to artifact | ||
uses: actions/upload-artifact@v3 | ||
if: matrix.experimental == false | ||
with: | ||
name: code-coverage | ||
path: "coverage.xml" | ||
retention-days: 5 | ||
|
||
- name: Prepare Build | ||
if: startsWith(github.ref, 'refs/tags/') && matrix.experimental == false | ||
run: | | ||
export COMPOSER_MEMORY_LIMIT=-1 | ||
export GITHUB_BUILD_PATH=${{github.workspace}} | ||
export GITHUB_REPO_SLUG="$(basename ${{github.workspace}})" | ||
export GITHUB_TAG="$(basename ${{github.ref}})" | ||
echo "File to be created : $GITHUB_BUILD_PATH/$GITHUB_REPO_SLUG-$GITHUB_TAG.zip" | ||
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | ||
chmod +x wp-cli.phar | ||
mv wp-cli.phar /usr/local/bin/wp | ||
wp package install wp-cli/dist-archive-command | ||
npm install | ||
npm run build | ||
composer install --no-dev --optimize-autoloader | ||
cd .. | ||
wp dist-archive $GITHUB_REPO_SLUG $GITHUB_BUILD_PATH/$GITHUB_REPO_SLUG-$GITHUB_TAG.zip | ||
cd $GITHUB_BUILD_PATH | ||
ls $GITHUB_BUILD_PATH | ||
- name: Deploy | ||
if: startsWith(github.ref, 'refs/tags/') && matrix.experimental == false | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT_FOR_GITHUB_ACTIONS }} | ||
with: | ||
files: | ||
${{github.workspace}}/*.zip | ||
|
||
- name: Trigger Bedrock Update | ||
if: (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/production') && matrix.experimental == false | ||
uses: pressbooks/composer-autoupdate-bedrock@v2 | ||
with: | ||
triggered-by: ${{ github.repository }} | ||
token: ${{ secrets.PAT_COMPOSER_UPDATE }} | ||
branch: ${{ github.ref }} | ||
|
||
coverage: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- tests | ||
name: Upload coverage | ||
if: needs.tests.outputs.coverage | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Fetch code coverage artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: code-coverage | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
.idea | ||
.idea/ | ||
vendor/ | ||
node_modules/ | ||
/wp-content/ | ||
.php-cs-fixer.cache | ||
.phpunit.result.cache | ||
tx | ||
.transifexrc | ||
LICENSE | ||
.DS_Store | ||
coverage.xml | ||
node_modules | ||
tests/logs | ||
vendor | ||
*.log |
Oops, something went wrong.