Skip to content

Commit

Permalink
define local enviroment for steps
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Foti <foti.giuseppe@gmail.com>
  • Loading branch information
MocioF committed Feb 12, 2024
1 parent 018eb97 commit b050854
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ permissions:

jobs:
test:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -115,11 +112,11 @@ jobs:
if: matrix.php-versions != env.coverage-php-version || matrix.wordpress-version != env.coverage-wp-version
run: vendor/bin/phpunit --debug

- name: When using PHP 8.1 and WP 6.4 - Run the tests and generate coverage report (single)
- name: When using PHP ${{coverage-php-version}} and WP ${{coverage-wp-version}} - Run the tests and generate coverage report (single)
if: matrix.php-versions == env.coverage-php-version && matrix.wordpress-version == env.coverage-wp-version
run: vendor/bin/phpunit --debug --coverage-php coverage/single.cov

- name: When using PHP 8.1 and WP 6.4 - Run the tests and generate coverage report (multisite)
- name: When using PHP ${{coverage-php-version}} and WP ${{coverage-wp-version}} - Run the tests and generate coverage report (multisite)
if: matrix.php-versions == env.coverage-php-version && matrix.wordpress-version == env.coverage-wp-version
run: vendor/bin/phpunit --debug -c tests/phpunit/multisite.xml --coverage-php=coverage/multisite.cov
env:
Expand All @@ -133,16 +130,25 @@ jobs:

- name: Setup Pages
if: matrix.php-versions == env.coverage-php-version && matrix.wordpress-version == env.coverage-wp-version
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
uses: actions/configure-pages@v4

- name: Upload artifact
if: matrix.php-versions == env.coverage-php-version && matrix.wordpress-version == env.coverage-wp-version
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
uses: actions/upload-pages-artifact@v3
with:
# Upload the coverage directory from the repository
path: './coverage-html'
- name: Deploy to GitHub Pages
if: matrix.php-versions == env.coverage-php-version && matrix.wordpress-version == env.coverage-wp-version
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
id: deployment
uses: actions/deploy-pages@v4

Expand Down

0 comments on commit b050854

Please # to comment.