From bc9a235244c520c66d0bf9939d688f7f41d9088a Mon Sep 17 00:00:00 2001 From: Benjamin Bolton <7146063+benpbolton@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:26:17 -0700 Subject: [PATCH 1/9] WIP: issue-15 From f52b37eacd9955275f745631919d643aee780474 Mon Sep 17 00:00:00 2001 From: Benjamin Bolton <7146063+benpbolton@users.noreply.github.com> Date: Thu, 12 Dec 2024 07:25:31 -0700 Subject: [PATCH 2/9] Stubbing out a potential action --- .github/workflows/action.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/action.yml diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml new file mode 100644 index 0000000..14017a2 --- /dev/null +++ b/.github/workflows/action.yml @@ -0,0 +1,29 @@ +name: General Tests + +on: + # Check on PR to develop branch. + pull_request: + branches: + - develop + types: [opened, synchronize, reopened, ready_for_review] + # Also check on weekly schedule to catch regressions early. + schedule: + - cron: '0 0 * * 0' + +jobs: + general-tests: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v4 + + - name: Run PHP Tests in src directory + uses: alleyinteractive/action-test-php@develop + with: + php-version: '8.2' + test-command: | + echo "Testing the default project configuration..." + yes '' | php ./configure.php --project_name=cwp --author_name=cwp + composer test \ No newline at end of file From d73db0a2d6e0e08ef02eaefc4cedd6724c02d9aa Mon Sep 17 00:00:00 2001 From: Benjamin Bolton <7146063+benpbolton@users.noreply.github.com> Date: Thu, 12 Dec 2024 07:37:49 -0700 Subject: [PATCH 3/9] Add concurrency, move configure to install step --- .github/workflows/action.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 14017a2..6593a5d 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -10,11 +10,15 @@ on: schedule: - cron: '0 0 * * 0' +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: general-tests: if: github.event.pull_request.draft == false runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 3 steps: - uses: actions/checkout@v4 @@ -23,7 +27,8 @@ jobs: uses: alleyinteractive/action-test-php@develop with: php-version: '8.2' + install-command: | + composer install + yes '' | php ./configure.php --project_name=cwp --author_name=cwp --author_email=cwp@alley.com test-command: | - echo "Testing the default project configuration..." - yes '' | php ./configure.php --project_name=cwp --author_name=cwp composer test \ No newline at end of file From c069ff230d2fca1d8c5f890a476fe0c9226e584a Mon Sep 17 00:00:00 2001 From: Benjamin Bolton <7146063+benpbolton@users.noreply.github.com> Date: Thu, 12 Dec 2024 07:53:58 -0700 Subject: [PATCH 4/9] Increase timeout, add github-token --- .github/workflows/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 6593a5d..e071ee7 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -18,7 +18,7 @@ jobs: general-tests: if: github.event.pull_request.draft == false runs-on: ubuntu-latest - timeout-minutes: 3 + timeout-minutes: 5 steps: - uses: actions/checkout@v4 @@ -27,6 +27,7 @@ jobs: uses: alleyinteractive/action-test-php@develop with: php-version: '8.2' + github-token: ${{ secrets.COMPOSER_ACCESS_TOKEN}} install-command: | composer install yes '' | php ./configure.php --project_name=cwp --author_name=cwp --author_email=cwp@alley.com From ef4884ec6668bc9577bdccf007015d354a6d7a43 Mon Sep 17 00:00:00 2001 From: Benjamin Bolton <7146063+benpbolton@users.noreply.github.com> Date: Thu, 12 Dec 2024 08:30:19 -0700 Subject: [PATCH 5/9] Increase timeout back to 10 --- .github/workflows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index e071ee7..5dd5464 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -18,7 +18,7 @@ jobs: general-tests: if: github.event.pull_request.draft == false runs-on: ubuntu-latest - timeout-minutes: 5 + timeout-minutes: 10 steps: - uses: actions/checkout@v4 From 86263ffaf085333a2e799544fa0ce83606ad26dd Mon Sep 17 00:00:00 2001 From: Benjamin Bolton <7146063+benpbolton@users.noreply.github.com> Date: Thu, 12 Dec 2024 08:53:37 -0700 Subject: [PATCH 6/9] Wrap yes in a subshell to avoid error exit codes --- .github/workflows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 5dd5464..683fb18 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -30,6 +30,6 @@ jobs: github-token: ${{ secrets.COMPOSER_ACCESS_TOKEN}} install-command: | composer install - yes '' | php ./configure.php --project_name=cwp --author_name=cwp --author_email=cwp@alley.com + (yes '') | php ./configure.php --project_name=cwp --author_name=cwp --author_email=cwp@alley.com test-command: | composer test \ No newline at end of file From 331f5ddf93e5392d4250aca28b2c94c843d7768a Mon Sep 17 00:00:00 2001 From: Benjamin Bolton <7146063+benpbolton@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:11:02 -0700 Subject: [PATCH 7/9] Attempt to catch yes error exit more explicitly --- .github/workflows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 683fb18..3f208fe 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -30,6 +30,6 @@ jobs: github-token: ${{ secrets.COMPOSER_ACCESS_TOKEN}} install-command: | composer install - (yes '') | php ./configure.php --project_name=cwp --author_name=cwp --author_email=cwp@alley.com + (yes '' || true) | php ./configure.php --project_name=cwp --cwp=cwp --author_email=cwp@alley.com test-command: | composer test \ No newline at end of file From b64e6983b28c4cc87e128d093a71e2d2750768c3 Mon Sep 17 00:00:00 2001 From: Benjamin Bolton <7146063+benpbolton@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:17:58 -0700 Subject: [PATCH 8/9] Fix type in author_name option --- .github/workflows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 3f208fe..d8bafc3 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -30,6 +30,6 @@ jobs: github-token: ${{ secrets.COMPOSER_ACCESS_TOKEN}} install-command: | composer install - (yes '' || true) | php ./configure.php --project_name=cwp --cwp=cwp --author_email=cwp@alley.com + (yes '' || true) | php ./configure.php --project_name=cwp --author_name=cwp --author_email=cwp@alley.com test-command: | composer test \ No newline at end of file From 1df3e9380cd8ed103f060ae86dd5e70dd5eba62c Mon Sep 17 00:00:00 2001 From: Benjamin Bolton <7146063+benpbolton@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:17:37 -0700 Subject: [PATCH 9/9] Use 'testing' vs. 'cwp' for project name --- .github/workflows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index d8bafc3..2407c96 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -30,6 +30,6 @@ jobs: github-token: ${{ secrets.COMPOSER_ACCESS_TOKEN}} install-command: | composer install - (yes '' || true) | php ./configure.php --project_name=cwp --author_name=cwp --author_email=cwp@alley.com + (yes '' || true) | php ./configure.php --project_name=Testing --author_name=Testing --author_email=testing@alley.com test-command: | composer test \ No newline at end of file