-
Notifications
You must be signed in to change notification settings - Fork 0
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 #5 from tarosky/feature/deploy-script-renewal
Feature/deploy script renewal
- Loading branch information
Showing
10 changed files
with
121 additions
and
103 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 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 |
---|---|---|
|
@@ -2,65 +2,66 @@ name: Deploy Plugin | |
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
matrix: | ||
operating-system: [ ubuntu-18.04 ] # OS. ubuntu-18.04 is also available. | ||
php: [ '5.6', '7.2', '7.4' ] # PHP versions to check. | ||
wp: [ 'latest', '5.5' ] # WordPress version to check. | ||
services: | ||
mysql: | ||
image: mysql:5.7 | ||
options: --health-cmd "mysqladmin ping --host 127.0.0.1 --port 3306" --health-interval 20s --health-timeout 10s --health-retries 10 | ||
ports: | ||
- 3306/tcp | ||
env: | ||
MYSQL_ROOT_PASSWORD: root | ||
name: WordPress ${{ matrix.wp }} in PHP ${{ matrix.php }} UnitTest | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: Setup PHP | ||
uses: nanasess/setup-php@master | ||
with: | ||
php-version: ${{ matrix.php }} | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress --no-suggest | ||
|
||
- name: Start MySQL | ||
run: sudo systemctl start mysql | ||
|
||
- name: Install WordPress | ||
run: bash bin/install-wp-tests.sh wordpress root root 127.0.0.1:3306 ${{ matrix.wp }} | ||
|
||
- name: Check PHP Unit | ||
run: composer test | ||
|
||
- name: Check PHP styntax | ||
run: composer lint | ||
# test: | ||
# runs-on: ${{ matrix.operating-system }} | ||
# strategy: | ||
# matrix: | ||
# operating-system: [ ubuntu-18.04 ] # OS. ubuntu-18.04 is also available. | ||
# php: [ '7.2', '7.4' ] # PHP versions to check. | ||
# wp: [ 'latest', '5.9' ] # WordPress version to check. | ||
# services: | ||
# mysql: | ||
# image: mysql:5.7 | ||
# options: --health-cmd "mysqladmin ping --host 127.0.0.1 --port 3306" --health-interval 20s --health-timeout 10s --health-retries 10 | ||
# ports: | ||
# - 3306/tcp | ||
# env: | ||
# MYSQL_ROOT_PASSWORD: root | ||
# name: WordPress ${{ matrix.wp }} in PHP ${{ matrix.php }} UnitTest | ||
# steps: | ||
# - uses: actions/checkout@master | ||
# | ||
# - name: Setup PHP | ||
# uses: nanasess/setup-php@master | ||
# with: | ||
# php-version: ${{ matrix.php }} | ||
# | ||
# - name: Validate composer.json and composer.lock | ||
# run: composer validate | ||
# | ||
# - name: Install dependencies | ||
# run: composer install --prefer-dist --no-progress --no-suggest | ||
# | ||
# - name: Start MySQL | ||
# run: sudo systemctl start mysql | ||
# | ||
# - name: Install WordPress | ||
# run: bash bin/install-wp-tests.sh wordpress root root 127.0.0.1:3306 ${{ matrix.wp }} | ||
# | ||
# - name: Check PHP Unit | ||
# run: composer test | ||
|
||
lint: | ||
name: Check PHP styntax | ||
uses: tarosky/workflows/.github/workflows/phpcs.yml@main | ||
with: | ||
version: 7.4 | ||
|
||
assets: | ||
name: Check Assets | ||
runs-on: ubuntu-18.04 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: actions/checkout@main | ||
|
||
- name: Install Node | ||
uses: actions/setup-node@v1 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '12' | ||
|
||
|
@@ -70,24 +71,36 @@ jobs: | |
- name: Check JS & CSS syntax | ||
run: npm run lint | ||
|
||
status-check: | ||
name: Status Check | ||
runs-on: ubuntu-latest | ||
if: always() | ||
needs: [ lint, assets ] | ||
steps: | ||
- uses: re-actors/alls-green@release/v1 | ||
with: | ||
jobs: ${{ toJSON(needs) }} | ||
|
||
|
||
release: | ||
name: Deploy GitHub Release | ||
needs: [ test, assets ] | ||
needs: [ status-check ] | ||
if: contains(github.ref, 'tags/') | ||
runs-on: ubuntu-18.04 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: actions/checkout@main | ||
|
||
- name: Confirm | ||
run: echo ${{ needs.pre_release.outputs.upload_url }} | ||
- name: Install Subversion | ||
run: sudo apt-get install subversion | ||
|
||
- name: Setup PHP | ||
uses: nanasess/setup-php@master | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '5.6' | ||
php-version: '7.4' | ||
tools: composer | ||
|
||
- name: Install NPM | ||
uses: actions/setup-node@v1 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '12' | ||
|
||
|
@@ -103,7 +116,6 @@ jobs: | |
SVN_USERNAME: ${{ secrets.WP_ORG_USERNAME_TAROSKY }} | ||
SVN_PASSWORD: ${{ secrets.WP_ORG_PASSWORD_TAROSKY }} | ||
|
||
|
||
- name: Create Release | ||
id: pre_release | ||
uses: actions/[email protected] | ||
|
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 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 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 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 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.