Skip to content

Commit

Permalink
test(unit) break down into groups, cache Chromedriver
Browse files Browse the repository at this point in the history
  • Loading branch information
lucatume committed Aug 1, 2024
1 parent 483cf60 commit f7a5a88
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 86 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ jobs:
- climodule
- functional
- muloader
- unit
- unit --skip-group=slow
- unit --group=isolated-1
- unit --group=isolated-2
- webdriver
- wpcli_module
- wploader_multisite
Expand Down Expand Up @@ -70,10 +72,33 @@ jobs:
restore-keys: |
${{ runner.os }}-composer-
- name: Get Chrome version
id: chrome-version
run: |
echo "version=$(/usr/bin/google-chrome --version)" >> $GITHUB_OUTPUT
- name: Get the vendor/bin directory path
id: vendor-bin-dir
run: |
echo "dir=${{ github.workspace }}/vendor/bin" >> $GITHUB_OUTPUT
- name: Ensure the vendor/bin directory exists
run: mkdir -p ${{ steps.chromedriver-cache.outputs.dir }}

- name: Restore vendor/bin from cache
uses: actions/cache@v3
id: vendor-bin-dir-cache
with:
path: ${{ steps.vendor-bin-dir.outputs.dir }}
key: ${{ runner.os }}-chromedriver-${{ steps.chrome-version.outputs.version }}
restore-keys: |
${{ runner.os }}-chromedriver-
- name: Install dependencies
run: composer update

- name: Update ChromeDriver
- name: Update ChromeDriver if required
if: steps.vendor-bin-dir-cache.outputs.cache-hit != 'true'
run: vendor/bin/codecept chromedriver:update --binary /usr/bin/google-chrome

- name: Create var/wordpress directory
Expand Down
2 changes: 1 addition & 1 deletion tests/_support/_generated/AcceptanceTesterActions.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php //[STAMP] d69cf0c7cb1a57260c281b530d9754b8
<?php //[STAMP] a5bbf842df430a46af3448e5e9451a96
// phpcs:ignoreFile
namespace _generated;

Expand Down
Loading

0 comments on commit f7a5a88

Please sign in to comment.