Skip to content

Commit

Permalink
added workflow; token as github secret
Browse files Browse the repository at this point in the history
  • Loading branch information
sugetha24 committed Feb 13, 2024
1 parent 52999a3 commit 8d007ef
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 1 deletion.
78 changes: 78 additions & 0 deletions .github/workflows/new-cvp-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
name: "Collection code testing"

on: pull_request

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
# ----------------------------------- #
# Test Requirements
# ----------------------------------- #
python_requirements:
name: Test Python requirements installation
runs-on: ubuntu-latest
needs: [ pre_commit ]
if: needs.file-changes.outputs.requirements == 'true'
strategy:
fail-fast: true
matrix:
python_version: [ "3.9", "3.10", "3.11", "3.12" ]
steps:
- name: 'Set environment variables'
run: |
echo "PY_COLORS=1" >> $GITHUB_ENV
echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: 'Install Python requirements'
run: |
pip install -r ansible_collections/arista/avd/requirements.txt -r ansible_collections/arista/avd/requirements-dev.txt --upgrade
# ----------------------------------- #
# DEPLOY_TO_CV MOLECULE
# ----------------------------------- #
molecule_eos_cli_config_gen:
name: Run molecule test for new cvp integration
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
avd_scenario:
- 'deploy_to_cv'
ansible_version:
- 'ansible-core<2.17.0 --upgrade'
# Also test minimum ansible version for one scenario.
# include:
# - avd_scenario: 'eos_cli_config_gen'
# ansible_version: 'ansible-core==2.14.0'
needs: [ pre_commit ]
if: needs.file-changes.outputs.config_gen == 'true'
steps:
- name: 'Set environment variables'
env:
CVAAS_TOKEN: ${{ secrets.CVAAS_TOKEN }}
run: |
echo "PY_COLORS=1" >> $GITHUB_ENV
echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Run molecule action
uses: arista-netdevops-community/action-molecule-avd@v1.7
with:
molecule_parentdir: 'ansible_collections/arista/avd'
molecule_command: 'converge'
molecule_args: '--scenario-name ${{ matrix.avd_scenario }}'
pip_file: ansible_collections/arista/avd/requirements.txt
galaxy_file: "ansible_collections/arista/avd/collections.yml"
ansible: ${{ matrix.ansible_version }}
check_git: true
check_git_enforced: true
# - uses: actions/upload-artifact@v3
# with:
# name: molecule-${{ matrix.avd_scenario }}-artifacts
# path: ${PWD}/ansible_collections/arista/avd/molecule/${{ matrix.avd_scenario }}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
vars:
# cv_server: staticstudio-1-cfec4cc2-eos.topo.testdrive.arista.com
cv_server: www.cv-staging.corp.arista.io
token: "{{ lookup('file', playbook_dir ~ '/token-cvaas.tok')}}"
# token: "{{ lookup('file', playbook_dir ~ '/token-cvaas.tok')}}"
token: "{{ lookup('env', 'CVAAS_TOKEN' }}"
ws_url: https://{{ cv_server }}/api/v3/services/arista.configlet.v1.ConfigletService/GetOne
cc_url: https://{{ cv_server }}/api/v3/services/arista.changecontrol.v1.ChangeControlService/GetOne
tag_url: https://{{ cv_server }}/api/v3/services/arista.tag.v2.TagAssignmentService/GetOne
Expand Down

0 comments on commit 8d007ef

Please sign in to comment.