Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
required: false
type: string
default: ""
lab_title:
required: false
type: string
default: ""
cml_lab:
default: tests/integration/labs/single.yaml
required: false
Expand Down Expand Up @@ -104,6 +108,24 @@ jobs:
VIRL_PASSWORD: ${{ secrets.virl_password }}
VIRL_USERNAME: admin

- name: Create the lab title
run: |
if [[ "${{ github.event_name }}" == 'pull_request_target' ]]; then
echo "CLABTITLE=${{ inputs.lab_title }}_PR${{ github.event.pull_request.number }}" >> $GITHUB_ENV
elif [[ "${{ github.event_name }}" == 'workflow_dispatch' ]]; then
shashort=$(echo ${{ github.sha }} | cut -c 1-30)
uuidval=$(uuidgen | cut -c 1-8)
echo "CLABTITLE=${{ inputs.lab_title }}_${shashort}_${uuidval}" >> $GITHUB_ENV
fi

- name: Print the lab title
run: echo ${{ env.CLABTITLE }}

- name: Add Lab Title to the lab file
run: >-
sed -i "s/title: ${{ inputs.network_os }}/title: ${{ env.CLABTITLE }}/" ${{ inputs.cml_lab }}
working-directory: ${{ steps.identify.outputs.collection_path }}

- name: Run integration tests
run: >-
python3 -m pytest tests/integration
Expand Down