Skip to content

Commit

Permalink
Add a test playbook with a github action
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsimard committed Nov 18, 2021
1 parent a7c6d88 commit d5bcc5b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/test-ansible.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: test ansible with ara

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build-release:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
run: |
python3 -m pip install --user --upgrade pip
python3 -m pip install --user ansible-core ara
- name: Test running a playbook
shell: bash
env:
ARA_API_CLIENT: http
ARA_API_SERVER: https://demo.recordsansible.org
ARA_API_USERNAME: ${{ secrets.ARA_API_USERNAME }}
ARA_API_PASSWORD: "${{ secrets.ARA_API_PASSWORD }}"
ARA_CALLBACK_THREADS: 4
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
ARA_DEFAULT_LABELS: >-
repository:${{ github.event.number }},pr:${{ github.repository }},ref:${{ github.ref }},sha:${{ github.sha }},workflow:${{ github.event.number }}
run: |
export ANSIBLE_CALLBACK_PLUGINS=$(python3 -m ara.setup.callback_plugins)
ansible-playbook -vv test-playbook.yml
7 changes: 7 additions & 0 deletions test-playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: Hello world
hosts: localhost
gather_facts: no
tasks:
- name: Hello task
debug:
msg: Just testing

0 comments on commit d5bcc5b

Please sign in to comment.