-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from alleyinteractive/pre-get-posts
Switching to use pre_get_posts for archiveless
- Loading branch information
Showing
11 changed files
with
311 additions
and
293 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,45 +8,6 @@ on: | |
|
||
jobs: | ||
built-branch: | ||
name: Built Branch | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Clear previous vendor | ||
shell: bash | ||
run: rm -rf vendor | ||
- name: Install dependencies | ||
uses: php-actions/composer@v6 | ||
with: | ||
php_version: 8.0 | ||
version: 2 | ||
args: --prefer-dist --no-dev | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: Install node dependencies (npm ci) | ||
run: npm install | ||
- name: Run npm build | ||
run: npm run build | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | ||
id: extract_branch | ||
- name: Push to -built branch | ||
shell: bash | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BUILT_BRANCH: '${{ steps.extract_branch.outputs.branch }}-built' | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "$GITHUB_ACTOR" | ||
rm -rf .gitignore docker_tag output.log .github | ||
mv .deployignore .gitignore | ||
git checkout -b $BUILT_BRANCH | ||
git add -A && git commit -m "Changes from $GITHUB_SHA" | ||
git push --force -u origin "${BUILT_BRANCH}" | ||
uses: alleyinteractive/.github/.github/workflows/built-branch.yml@main | ||
with: | ||
node: 16 |
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 |
---|---|---|
|
@@ -7,49 +7,7 @@ on: | |
- '!*-built' | ||
|
||
jobs: | ||
built-branch: | ||
name: Create Built Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Clear previous vendor | ||
shell: bash | ||
run: rm -rf vendor && rm -rf composer.lock | ||
- name: Install dependencies | ||
uses: php-actions/composer@v6 | ||
with: | ||
php_version: 8.0 | ||
version: 2 | ||
args: --prefer-dist --no-dev | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: Install node dependencies (npm ci) | ||
run: npm install | ||
- name: Run npm build | ||
run: npm run build | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | ||
id: vars | ||
- name: Push to -built branch | ||
shell: bash | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BUILT_BRANCH: '${{ steps.vars.outputs.tag }}-built' | ||
TAG_NAME: '${{ steps.vars.outputs.tag }}-built' | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "$GITHUB_ACTOR" | ||
rm -rf .gitignore docker_tag output.log .github | ||
mv .deployignore .gitignore | ||
git checkout -b $BUILT_BRANCH | ||
git add -A && git commit -m "Built changes for $TAG_NAME" | ||
git tag -a "$TAG_NAME" -m "Build assets for $TAG_NAME" | ||
git push origin "refs/tags/$TAG_NAME" | ||
built-tag: | ||
uses: alleyinteractive/.github/.github/workflows/built-tag.yml@main | ||
with: | ||
node: 16 |
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 |
---|---|---|
|
@@ -9,43 +9,5 @@ on: | |
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
php: [8.0] | ||
name: PHP ${{ matrix.php }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Get Composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Set up Composer caching | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-composer-dependencies | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ matrix.php }}-composer- | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd | ||
tools: composer:v2 | ||
coverage: none | ||
- name: Validate Composer | ||
run: composer validate --strict | ||
- name: Install dependencies | ||
uses: nick-invision/[email protected] | ||
with: | ||
timeout_minutes: 5 | ||
max_attempts: 5 | ||
command: composer install | ||
- name: Run phpcs | ||
run: composer run phpcs | ||
coding-standards: | ||
uses: alleyinteractive/.github/.github/workflows/php-coding-standards.yml@main |
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 |
---|---|---|
|
@@ -4,27 +4,8 @@ on: | |
pull_request: | ||
|
||
jobs: | ||
npm-ci: | ||
name: (npm) Install, build, and test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
steps: | ||
- name: Cancel previous runs of this workflow (pull requests only) | ||
if: ${{ github.event_name == 'pull_request' }} | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: Install node dependencies (npm ci) | ||
run: npm install | ||
- name: Run npm lint | ||
run: npm run lint | ||
- name: Run npm build | ||
run: npm run build | ||
node-tests: | ||
uses: alleyinteractive/.github/.github/workflows/node-tests.yml@main | ||
with: | ||
node: 16 | ||
run-test: false |
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 |
---|---|---|
|
@@ -9,82 +9,12 @@ on: | |
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
services: | ||
mysql: | ||
image: mysql:5.7 | ||
env: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: yes | ||
ports: | ||
- 3306:3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
redis: | ||
image: redis:5.0 | ||
ports: | ||
- 6379:6379 | ||
options: --entrypoint redis-server | ||
continue-on-error: ${{ matrix.can_fail }} | ||
php-tests: | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest] | ||
php: [7.4, 8.0] | ||
wp_version: ["latest"] | ||
can_fail: [false] | ||
stability: [prefer-stable] | ||
|
||
name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} | ||
env: | ||
CACHEDIR: /tmp/test-cache | ||
WP_CORE_DIR: /tmp/wordpress | ||
WP_VERSION: ${{ matrix.wp_version }} | ||
WP_DB_HOST: 127.0.0.1 | ||
WP_DB_USER: root | ||
WP_DB_PASSWORD: '""' | ||
|
||
steps: | ||
- name: Cancel previous runs of this workflow (pull requests only) | ||
if: ${{ github.event_name == 'pull_request' }} | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get Composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Set up Composer caching | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-composer-dependencies | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-${{ matrix.stability }}-composer-${{ hashFiles('**/composer.lock') }}-- | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.stability }}-composer- | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd | ||
tools: composer:v2 | ||
coverage: none | ||
|
||
- name: Validate Composer | ||
run: composer validate --strict | ||
|
||
- name: Install dependencies | ||
uses: nick-invision/[email protected] | ||
with: | ||
timeout_minutes: 5 | ||
max_attempts: 5 | ||
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction | ||
|
||
- name: Test Package | ||
shell: bash | ||
run: composer run phpunit | ||
wordpress: ["latest"] | ||
uses: alleyinteractive/.github/.github/workflows/php-tests.yml@main | ||
with: | ||
php: ${{ matrix.php }} | ||
wordpress: ${{ matrix.wordpress }} |
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,7 @@ | ||
# Changelog | ||
|
||
All notable changes to this plugin will be documented in this file. | ||
|
||
## 1.0.0 | ||
|
||
- Initial release |
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
Oops, something went wrong.