# GENERATED by tools/pack_assets.py: Travel, Airlines & Hospitality pack 1.0.0.
# Run your application tests against certified, masked, ephemeral Travel, Airlines & Hospitality test data.
# Based on examples/ci/github-actions/datanivra-test-data.yml in the DataNivra repository: copy
# examples/ci/datanivra_ci.py into your repository (standard library only) and commit
# ci/dataset-request.json (start from api/dataset-request.json of this bundle, with your ids and
# APPROVED policy versions; omit target_environment_id — the pipeline supplies it).
name: app-tests-with-datanivra-travel-hospitality-data

on:
  pull_request:

permissions:
  contents: read

concurrency:
  group: datanivra-travel-hospitality-${{ github.ref }}
  cancel-in-progress: true

jobs:
  app-tests:
    runs-on: [self-hosted, datanivra-ci]   # in the network of the agent and the CI target
    timeout-minutes: 60
    env:
      DATANIVRA_API_URL: ${{ secrets.DATANIVRA_API_URL }}
      DATANIVRA_API_TOKEN: ${{ secrets.DATANIVRA_API_TOKEN }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.12'
      - name: Test against certified ephemeral Travel, Airlines & Hospitality data
        run: >
          python ci/datanivra_ci.py run
          --request-template ci/dataset-request.json
          --agent-id "${{ secrets.DATANIVRA_AGENT_ID }}"
          --target-ref "${{ vars.DATANIVRA_TARGET_REF }}"
          --tier QA --ttl-hours 2
          --test-command "python -m pytest -q"
          --pin-out datanivra-pin.json
          --evidence datanivra-evidence.json
      - name: Upload DataNivra evidence (metadata only)
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: datanivra-travel-hospitality-evidence-${{ github.run_id }}
          path: |
            datanivra-evidence.json
            datanivra-pin.json
          if-no-files-found: warn
