This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
Merge pull request #762 from cisco-open/fr/integration-tests-gh-actions #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- dev-uxmt | |
# This ensures only one job runs at a time across all workflows | |
concurrency: | |
group: integration_tests | |
cancel-in-progress: false | |
jobs: | |
integration_tests: | |
runs-on: ubuntu-latest | |
environment: integration | |
env: | |
PASSPHRASE: ${{ secrets.PASSPHRASE }} | |
VMANAGE_URL: ${{ secrets.VMANAGE_URL }} | |
VMANAGE_USERNAME: ${{ secrets.VMANAGE_USERNAME }} | |
VMANAGE_PASSWORD: ${{ secrets.VMANAGE_PASSWORD }} | |
VMANAGE_PORT: ${{ secrets.VMANAGE_PORT }} | |
RUN_ID: ${{ github.event.pull_request.number }} | |
CATALYSTWAN_DEVEL: true | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Check if in allowed time window | |
run: | | |
hour=$(TZ='America/Los_Angeles' date +%H) | |
if [ $hour -ge 22 ] || [ $hour -lt 7 ]; then | |
echo "Current time is within the allowed window (10 PM - 7 AM PDT)." | |
else | |
echo "Error: Current time is outside the allowed window (10 PM - 7 AM PDT)." | |
exit 1 | |
fi | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Set Up Poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: 1.3.1 | |
- name: Install dependencies | |
run: poetry install --sync -v | |
- name: Run Tests | |
run: poetry run pytest catalystwan/integration_tests | |
- name: Encrypt artifacts | |
run: | | |
mv catalystwan.log artifacts/catalystwan.log | |
tar -czf archive.tar.gz artifacts | |
gpg --batch --yes --passphrase="$PASSPHRASE" -c archive.tar.gz | |
- name: Store encrypted artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: encrypted-artifacts | |
path: archive.tar.gz.gpg | |
retention-days: 1 |