-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add smoke-test workflow #103
base: master
Are you sure you want to change the base?
Changes from all commits
cbf7e24
5905555
181fd1e
8fa1c21
dfdd8f0
a84be67
29de8ee
6d9d92c
10a6657
f20f4b1
17e1e0e
a48d28e
5b7060a
193885c
d7fa83e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
name: | ||
description: Name of the driver test | ||
required: true | ||
type: string | ||
driverRepoUrl: | ||
description: Git URL of the driver repository | ||
required: true | ||
type: string | ||
driverRepoBranch: | ||
description: Driver repository branch to check out | ||
required: true | ||
type: string | ||
php: | ||
description: PHP version for running tests | ||
required: true | ||
type: string | ||
setUpCmd: | ||
description: Command to run before test | ||
required: false | ||
type: string | ||
testCmd: | ||
description: Command that runs the test | ||
required: true | ||
type: string | ||
tearDownCmd: | ||
description: Command to run after test | ||
required: false | ||
type: string | ||
Comment on lines
+4
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe some of the form fields (e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nah. The But good point, we could do that if/when something more specific comes up. |
||
|
||
jobs: | ||
Test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up workspace for driver repo | ||
# language=bash | ||
run: git clone --single-branch --branch "${{ inputs.driverRepoBranch }}" "${{ inputs.driverRepoUrl }}" . | ||
|
||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
coverage: none | ||
php-version: ${{ inputs.php }} | ||
|
||
- name: Install driver dependencies | ||
# language=bash | ||
run: composer install --no-interaction --ansi --no-progress | ||
|
||
- name: Set up driver test suite as composer dependency | ||
# This is instead of `composer require "mink/driver-testsuite:dev-master#${{ github.sha }}"`, which works with forks | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ./vendor/mink/driver-testsuite | ||
|
||
- name: Set up | ||
# language=bash | ||
run: | | ||
mkdir ./logs | ||
MINK_HOST=0.0.0.0:8002 ./vendor/bin/mink-test-server &> ./logs/mink-test-server.log & | ||
eval "${{ inputs.setUpCmd }}" | ||
curl --retry 5 --retry-all-errors --retry-delay 1 --max-time 10 --head -X GET http://localhost:8002/ | ||
|
||
- name: Run tests | ||
# language=bash | ||
run: eval "${{ inputs.testCmd }}" | ||
|
||
- name: Tear down | ||
# language=bash | ||
run: | | ||
eval "${{ inputs.tearDownCmd }}" | ||
|
||
- name: Upload logs as artifact | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: ${{ inputs.name }}-logs | ||
path: ./logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just pushed a major update; it should work much better now and should be relatively easy to follow.
There's one major annoyance (on GitHub's side): they do not evaluate expressions in
job.name
, (that line above), when the job is skipped.This causes some ugly UI:
But the impact is just that, so I think we can live with it.