Skip to content

Fix handpicked posts should orderby include #552

Fix handpicked posts should orderby include

Fix handpicked posts should orderby include #552

Workflow file for this run

name: Test
on:
pull_request:
workflow_dispatch:
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Authenticate with Fontawesome NPM reposity
run: |
npm config set "//npm.fontawesome.com/:_authToken" ${{ secrets.NPM_FONTAWESOME_AUTH_TOKEN }}
- name: Read PHP version from composer.json to env
run: |
echo "PHP_VERSION=$(cat ./composer.json | jq -r '.config.platform.php')" >> "$GITHUB_ENV"
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
env:
COMPOSER_TOKEN: ${{ secrets.PACKAGIST_GITHUB_TOKEN }}
- name: Start MySQL service
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE db;' -uroot -proot
mysql -e "CREATE USER 'db'@'localhost' IDENTIFIED BY 'db';" -uroot -proot
mysql -e "GRANT ALL PRIVILEGES ON db.* TO 'db'@'localhost' WITH GRANT OPTION;" -uroot -proot
- name: Configure basic http authentication for Composer
run: composer config --global http-basic.satispress.generodigital.com ${{ secrets.SATISPRESS_API_KEY }} ${{ secrets.SATISPRESS_PASSWORD }}
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Composer Cache
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install development packages to run tests
run: composer install:development
- name: Run CI tests
run: composer ci --no-interaction
- name: Launch web server
run: ./vendor/bin/wp server &
- name: Setup .env
run: |
cp .env.example .env
sed -i 's/WP_HOME=.*/WP_HOME=http:\/\/localhost:8080/g' .env
sed -i 's/DB_HOST=.*/DB_HOST=localhost/g' .env
- name: Install WordPress
run: |
./vendor/bin/wp core install \
--url=http://localhost:8080 \
--title="Bedrock" \
--admin_user="admin" \
--admin_email="bedrock@example.test" \
--skip-email
# - name: Install WordPress (multisite)
# run: |
# ./vendor/bin/wp core multisite-install \
# --url=http://localhost:8080 \
# --title="Bedrock" \
# --admin_email="bedrock@example.test" \
# --skip-config \
# --skip-email
- name: Optimize acorn
run: ./vendor/bin/wp acorn optimize
- name: Load frontpage and verify app.js script is loaded
run: curl http://localhost:8080/ | grep '<script.*src=".*app/themes/gds/public/scripts/app.js'
- name: Run unit tests
run: composer phpunit