Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
resmo committed May 17, 2020
0 parents commit 71a5476
Show file tree
Hide file tree
Showing 32 changed files with 1,897 additions and 0 deletions.
110 changes: 110 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Collection integration

on:
push:
branches:
- master
pull_request:
# schedule:
# - cron: 3 0 * * * # Run daily at 0:03 UTC

jobs:
build-collection-artifact:
name: Build collection
runs-on: ${{ matrix.runner-os }}
strategy:
matrix:
runner-os:
- ubuntu-latest
ansible-version:
- git+https://github.com/ansible/ansible.git@devel
runner-python-version:
- 3.8
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.runner-python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.runner-python-version }}
- name: Set up pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}
- name: Install Ansible ${{ matrix.ansible-version }}
run: >-
python -m
pip
install
--user
${{ matrix.ansible-version }}
- name: Build a collection tarball
run: >-
~/.local/bin/ansible-galaxy
collection
build
--output-path
"${GITHUB_WORKSPACE}/.cache/collection-tarballs"
- name: Store migrated collection artifacts
uses: actions/upload-artifact@v1
with:
name: >-
collection
path: .cache/collection-tarballs

sanity-test-collection-via-containers:
name: Sanity in container via Python ${{ matrix.python-version }}
needs:
- build-collection-artifact
runs-on: ${{ matrix.runner-os }}
strategy:
fail-fast: false
matrix:
runner-os:
- ubuntu-latest
runner-python-version:
- 3.6
ansible-version:
- git+https://github.com/ansible/ansible.git@devel
steps:
- name: Set up Python ${{ matrix.runner-python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.runner-python-version }}
- name: Set up pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-sanity-containers
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Ansible ${{ matrix.ansible-version }}
run: >-
python -m
pip
install
--user
${{ matrix.ansible-version }}
- name: Download migrated collection artifacts
uses: actions/download-artifact@v1
with:
name: >-
collection
path: .cache/collection-tarballs
- name: Install the collection tarball
run: >-
~/.local/bin/ansible-galaxy
collection
install
.cache/collection-tarballs/*.tar.gz
- name: Run collection sanity tests
run: >-
~/.local/bin/ansible-test
sanity
--color
--requirements
--docker
-vvv
working-directory: >-
/home/runner/.ansible/collections/ansible_collections/ngine_io/pingping
25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Upload release to Galaxy

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible
- name: Build and publish
env:
ANSIBLE_GALAXY_API_KEY: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}
run: |
ansible-galaxy collection build .
ansible-galaxy collection publish *.tar.gz --api-key $ANSIBLE_GALAXY_API_KEY
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.tar.gz
tests/output/
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Contributing

Any contribution is welcome and we only ask contributors to:

- Create an issues for any significant contribution that would change a large portion of the code base.
- Provide at least integration tests for any contribution
Loading

0 comments on commit 71a5476

Please sign in to comment.