diff --git a/.github/actions/hurl-setup/action.yml b/.github/actions/hurl-setup/action.yml new file mode 100644 index 00000000..d780732e --- /dev/null +++ b/.github/actions/hurl-setup/action.yml @@ -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 diff --git a/.github/actions/hurl-test/action.yml b/.github/actions/hurl-test/action.yml new file mode 100644 index 00000000..3b540875 --- /dev/null +++ b/.github/actions/hurl-test/action.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/end-to-end.yml b/.github/workflows/end-to-end.yml new file mode 100644 index 00000000..0b192949 --- /dev/null +++ b/.github/workflows/end-to-end.yml @@ -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 }}' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e37507b..6932167c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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