Skip to content

Commit

Permalink
Merge branch 'main' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
abikouo authored Apr 17, 2024
2 parents fbb979b + fe5227f commit 11dc229
Showing 1 changed file with 22 additions and 0 deletions.
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: ${{ github.event.repository.name }}
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=$(git rev-parse --short HEAD)
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

0 comments on commit 11dc229

Please sign in to comment.