Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tahigash GitHub actions examples #46

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
156 changes: 156 additions & 0 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Run Tests

on:
- push
- pull_request

jobs:
ubuntu-latest:

runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install pyATS
run: |
python -m pip install pip setuptools wheel --upgrade
pip install pyats[full] yang.connector rest.connector --pre
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: pyats version check
run: pyats version check
# - name: ComparePlugin
# run: |
# cat <<EOF > easypy_config.yaml
# plugins:
# ComparePlugin:
# order: 120
# enabled: True
# module: genie.utils.compare
# EOF
# export PYATS_CONFIGURATION_EASYPY=easypy_config.yaml
- name: run examples
run: |
cd basic
pyats run job basic_example_job.py --no-mail || echo $?
unzip -c $(find ~/.pyats/archive -type f -mmin -1) rerun.results > rerun.results
grep -A100000 'Task.*' rerun.results > rerun_results
diff -I 'testscript:' -B -C5 rerun_results results/basic_example_result_ext.yaml
sleep 60
cd ..
- name: comprehensive
run: |
cd comprehensive/job
pyats run job example_job.py --no-mail || echo $?
unzip -c $(find ~/.pyats/archive -type f -mmin -1) rerun.results > rerun.results
grep -A100000 'Task.*' rerun.results > rerun_results
diff -I 'testscript:' -B -C5 rerun_results results/comprehensive_results_ext.yaml
cd ..

macos-11:

runs-on: macos-11

strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install pyATS
run: |
python -m pip install pip setuptools wheel --upgrade
pip install pyats[full] yang.connector rest.connector --pre
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: pyats version check
run: pyats version check
# - name: ComparePlugin
# run: |
# cat <<EOF > easypy_config.yaml
# plugins:
# ComparePlugin:
# order: 120
# enabled: True
# module: genie.utils.compare
# EOF
# export PYATS_CONFIGURATION_EASYPY=easypy_config.yaml
- name: run examples
run: |
cd basic
pyats run job basic_example_job.py --no-mail || echo $?
unzip -c $(find ~/.pyats/archive -type f -mmin -1) rerun.results > rerun.results
grep -A100000 'Task.*' rerun.results > rerun_results
diff -I 'testscript:' -B -C5 rerun_results results/basic_example_result_ext.yaml
sleep 60
cd ..
- name: comprehensive
run: |
cd comprehensive/job
pyats run job example_job.py --no-mail || echo $?
unzip -c $(find ~/.pyats/archive -type f -mmin -1) rerun.results > rerun.results
grep -A100000 'Task.*' rerun.results > rerun_results
diff -I 'testscript:' -B -C5 rerun_results results/comprehensive_results_ext.yaml
cd ..

macos-10:

runs-on: macos-10.15

strategy:
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install pyATS
run: |
python -m pip install pip setuptools wheel --upgrade
pip install pyats[full] yang.connector rest.connector --pre
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: pyats version check
run: pyats version check
# - name: ComparePlugin
# run: |
# cat <<EOF > easypy_config.yaml
# plugins:
# ComparePlugin:
# order: 120
# enabled: True
# module: genie.utils.compare
# EOF
# export PYATS_CONFIGURATION_EASYPY=easypy_config.yaml
- name: run examples
run: |
cd basic
pyats run job basic_example_job.py --no-mail || echo $?
unzip -c $(find ~/.pyats/archive -type f -mmin -1) rerun.results > rerun.results
grep -A100000 'Task.*' rerun.results > rerun_results
diff -I 'testscript:' -B -C5 rerun_results results/basic_example_result_ext.yaml
sleep 60
cd ..
- name: comprehensive
run: |
cd comprehensive/job
pyats run job example_job.py --no-mail || echo $?
unzip -c $(find ~/.pyats/archive -type f -mmin -1) rerun.results > rerun.results
grep -A100000 'Task.*' rerun.results > rerun_results
diff -I 'testscript:' -B -C5 rerun_results results/comprehensive_results_ext.yaml
cd ..
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# pyATS | Library Examples

This repository contains pyATS and its library's usage examples. The purpose
Expand Down