Skip to content
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

Create (and document) GitHub Action to integrate with Docker image #682

Open
lukehesluke opened this issue Apr 2, 2024 · 1 comment
Open

Comments

@lukehesluke
Copy link
Contributor

lukehesluke commented Apr 2, 2024

CURRENT STATUS (written by @lukehesluke)

SO, this is what needs to be done for this issue:

  1. Await feat: Add Docker support #597 to be merged, or branch off of it.
  2. Add action.yml, based off of Create (and document) GitHub Action to integrate with Docker image #682 (comment), but fixing the config arg.
  3. Document how to use action.yml, using the example provided in ORIGINAL COMMENT > Task 2

ORIGINAL COMMENT (written by @nickevansuk)

Task 1: Fully document the docker run call

Explain all of the following:

docker run -it -e INPUT_CONFIG=/config/strmln.json -e NODE_ENV=strmln -p 3000:3000 -v ${PWD}/config:/config -v ${PWD}/packages/openactive-integration-tests/output:/openactive-test-suite/packages/openactive-integration-tests/output ghcr.io/openactive/test-suite:latest -- booking-partner-authentication

And potentially simplify this command too

Task 2: Create and document GitHub Action to integrate with Docker image

Assuming dev.json is renamed openactive-test-suite-config.json and exists in a directory named example-booking-system in the GitHub workspace, and assuming that within the GitHub action the app is running on http://localhost:8081/ then the following should work currently, and output the resulting cert to conformance/ in the current workspace

    - name: Run OpenActive Test Suite
      uses: openactive/openactive-test-suite@d7cbdac7f03ce75f282927fe67c9a375f1e440a8
      with:
        config: example-booking-system/openactive-test-suite-config.json
        NODE_CONFIG: |
          { "ci": true, "consoleOutputLevel": "detail", "broker": {"datasetSiteUrl": "http://localhost:8081/openactive", "outputPath": "/github/workspace/output/"}, "integrationTests": {"testDatasetIdentifier": "github-ci", "outputPath": "/github/workspace/output/", "generateConformanceCertificate": true, "conformanceCertificatePath": "/github/workspace/conformance/", "conformanceCertificateId": "https://openactive-certificate.example.com/" }}
        NODE_ENV: openactive-test-suite-config

    - name: Upload OpenActive Test Suite output as artifact for debugging
      uses: actions/upload-artifact@v2
      if: ${{ success() || failure() }}
      with:
        name: openactive-test-suite
        path: ./output/

Ensure that all of the above works and is clearly documented at the appropriate levels within README.md and also developer.openactive.io

@lukehesluke lukehesluke self-assigned this Apr 2, 2024
@lukehesluke lukehesluke converted this from a draft issue Apr 2, 2024
@lukehesluke lukehesluke changed the title Better documentation for how to run test suite with docker, and also with GitHub Actions Create GitHub Action to integrate with Docker image and document it Apr 2, 2024
@lukehesluke lukehesluke changed the title Create GitHub Action to integrate with Docker image and document it Create (and document) GitHub Action to integrate with Docker image Apr 2, 2024
@lukehesluke
Copy link
Contributor Author

action.yml:

name: 'OpenActive Test Suite'
description: 'Test suite for OpenActive implementations'
inputs:
  args:  # id of input
    description: 'Arguments to pass to `npm start` of OpenActive Test Suite'
    required: false
    default: ''
  config:  # id of input
    description: 'The path of a config file to copy into ./config/ of OpenActive Test Suite'
    required: false
    default: ''
  NODE_CONFIG:  # id of input
    description: 'JSON configuration string to pass into OpenActive Test Suite'
    required: true
    default: '{ "ci": true }'
  NODE_ENV:  # id of input
    description: 'Value of NODE_ENV environment variable to pass into OpenActive Test Suite'
    required: false
    default: ''
  NODE_APP_INSTANCE:  # id of input
    description: 'Value of NODE_APP_INSTANCE environment variable to pass into OpenActive Test Suite'
    required: false
    default: ''
runs:
  using: 'docker'
  image: 'docker://ghcr.io/openactive/test-suite:latest'
  args:
    - ${{ inputs.args }}
  env:
    FORCE_COLOR: 1
    NODE_CONFIG: ${{ inputs.NODE_CONFIG }}
    NODE_ENV: ${{ inputs.NODE_ENV }}
    NODE_APP_INSTANCE: ${{ inputs.NODE_APP_INSTANCE }}

@lukehesluke lukehesluke moved this from 🏗 In progress to 📋 Backlog in OpenActive Infrastructure Apr 2, 2024
@lukehesluke lukehesluke removed their assignment Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant