Skip to content

Commit

Permalink
ci: gh actions and workflow for running hurl test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rosado committed Oct 21, 2024
1 parent 7bb787f commit 1deb852
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/actions/hurl-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "Hurl Setup"
description: "Installs hurl (hurl.dev)"
runs:
using: 'composite'
steps:
- id: install-hurl
shell: bash
run: |
curl --location --remote-name https://github.com/Orange-OpenSource/hurl/releases/download/5.0.1/hurl_5.0.1_amd64.deb
sudo dpkg -i hurl_5.0.1_amd64.deb
23 changes: 23 additions & 0 deletions .github/actions/hurl-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Hurl Test"
description: "Runs hurl tests (hurl.dev)"
inputs:
app_host:
description: "The host of the app to test (including the port)"
required: false
default: 'http://localhost:8085'
report_dir:
description: "The directory to store test report in. If not set, hurl will not generate a report."
required: false
default: ''
runs:
using: 'composite'
steps:
- id: run-hurl
shell: bash
env:
HURL_app_host: ${{ inputs.app_host }}
HURL_report_dir: ${{ inputs.report_dir }}
run: |
mkdir -p test/hurl/common
curl --location -o test/hurl/common/geox-geoy-example.csv https://gist.githubusercontent.com/rosado/3994e2420857d5c6b0e3bd8dc1488aa1/raw/bf1b52316f66a480a6d116c993ffd57d119094f9/geox-geoy-example.csv
test/hurl/runner.sh
22 changes: 22 additions & 0 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Run end-to-end tests
run-name: Run end to end tests on '${{ inputs.host }}' by @${{ github.actor }}

on:
workflow_dispatch:
inputs:
host:
required: true
type: string
description: Host to test against (e.g. https://example.com:8080)

jobs:
test:
runs-on: ubuntu-latest
environment: development
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/hurl-setup
- uses: ./.github/actions/hurl-test
with:
app_host: ${{ inputs.host }}
report_dir: 'hurl-test-report-${{ github.run_number }}'
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ jobs:
- name: Run unit tests
run: npm run test:unit

- uses: ./.github/actions/hurl-setup
- uses: ./.github/actions/hurl-test
with:
app_host: http://localhost:8085
report_dir: 'hurl-test-report'

- uses: actions/upload-artifact@v4
if: always()
with:
name: hurl-test-report
path: hurl-test-report/
retention-days: 30

- uses: ./.github/actions/playwright-setup
- name: Run integration tests
run: npm run test:integration
Expand Down

0 comments on commit 1deb852

Please sign in to comment.