Skip to content

Commit

Permalink
Debug Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
craigpearson committed May 26, 2024
1 parent 27853f3 commit 27dbcd6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Run Tests
# Comment

on:
push:
branches: [ main, workflow ]
Expand Down Expand Up @@ -29,17 +29,24 @@ jobs:
run: |
MIN_PHP_VERSION=${{ env.PHP_VERSION }}
PHP_VERSIONS=$(curl -s https://api.github.com/repos/php/php-src/git/refs/tags | jq -r '.[].ref' | grep -E 'refs/tags/php-[0-9]+\.[0-9]+\.[0-9]+$' | sed 's#refs/tags/php-##' | grep -vE 'alpha|beta|rc' | awk -v min=$MIN_PHP_VERSION '$1 >= min')
PHP_VERSIONS_JSON=$(echo $PHP_VERSIONS | jq -Rnc '[inputs | split("\n") | .[] | select(length > 0)]')
PHP_VERSIONS_JSON=$(echo "$PHP_VERSIONS" | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "PHP_VERSIONS=$PHP_VERSIONS_JSON" >> $GITHUB_ENV
echo "versions=$PHP_VERSIONS_JSON" >> $GITHUB_OUTPUT
- name: Fetch available WP versions
id: set-wp-versions
run: |
MIN_WP_VERSION=${{ env.WP_VERSION }}
WP_VERSIONS=$(curl -s https://api.github.com/repos/WordPress/WordPress/git/refs/tags | jq -r '.[].ref' | grep -E 'refs/tags/[0-9]+\.[0-9]+\.[0-9]+$' | sed 's#refs/tags/##' | awk -v min=$MIN_WP_VERSION '$1 >= min')
WP_VERSIONS_JSON=$(echo $WP_VERSIONS | jq -Rnc '[inputs | split("\n") | .[] | select(length > 0)]')
WP_VERSIONS_JSON=$(echo "$WP_VERSIONS" | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "WP_VERSIONS=$WP_VERSIONS_JSON" >> $GITHUB_ENV
echo "versions=$WP_VERSIONS_JSON" >> $GITHUB_OUTPUT
- name: Debug Outputs
run: |
echo "PHP Versions JSON: ${{ steps.set-php-versions.outputs.versions }}"
echo "WP Versions JSON: ${{ steps.set-wp-versions.outputs.versions }}"
run-tests:
needs: fetch-versions
runs-on: ubuntu-latest
Expand Down

0 comments on commit 27dbcd6

Please sign in to comment.