Skip to content

Bump ansible from 2.9.27 to 8.5.0 #163

Bump ansible from 2.9.27 to 8.5.0

Bump ansible from 2.9.27 to 8.5.0 #163

Workflow file for this run

---
name: Ansible collection
'on':
push:
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install yamllint
run: sudo apt install yamllint
- name: Lint yaml
run: yamllint .
test:
runs-on: ubuntu-latest
env:
ANSIBLE_FORCE_COLOR: "True"
steps:
- name: Log github.ref
run: echo ${{ github.ref }}
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8==4.0.0 pytest==6.2.4
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install kernel extra modules
run: sudo apt-get install -y linux-modules-extra-$(uname -r)
- name: Sanity tests with dependencies
run: ansible-test sanity --requirements --python 3.8
working-directory: ansible_collections/amarao/ip
- name: Unit tests with dependencies
run: ansible-test units --requirements --python 3.8
working-directory: ansible_collections/amarao/ip
- name: Integration tests with dependencies
run: ansible-test integration --requirements --python 3.8 --local --allow-root
working-directory: ansible_collections/amarao/ip
- name: Cleanup
run: rm -fr ansible_collections/amarao/ip/tests/output ansible_collections/amarao/ip/.pytest_cache
- name: Try-build by ansible-galaxy
run: ansible-galaxy collection build
working-directory: ansible_collections/amarao/ip
- name: Lint changelog
run: antsibull-lint changelog-yaml ansible_collections/amarao/ip/changelogs/changelog.yaml
build:
runs-on: ubuntu-latest
needs: test
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Remove tests from final distribution
run: rm -r tests/
working-directory: ansible_collections/amarao/ip
- name: Build collection
run: ansible-galaxy collection build
working-directory: ansible_collections/amarao/ip
- name: Extract version
id: version
run: |
version=$(cat galaxy.yml |grep ^version|awk '{print $2}')
echo "::set-output name=version::$version"
working-directory: ansible_collections/amarao/ip
- name: Print artifact info
run: |
ls -la amarao-ip-${{ steps.version.outputs.version }}.tar.gz
sha512sum amarao-ip-${{ steps.version.outputs.version }}.tar.gz
tar tzf amarao-ip-${{ steps.version.outputs.version }}.tar.gz
working-directory: ansible_collections/amarao/ip
- name: Save artifact
if: ${{ endsWith(github.ref, steps.version.outputs.version) }}
uses: actions/upload-artifact@v2
with:
name: collection
path: ansible_collections/amarao/ip/amarao-ip-${{ steps.version.outputs.version }}.tar.gz
publish:
runs-on: ubuntu-latest
needs: build
if: ${{ endsWith(github.ref, needs.build.outputs.version) }}
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: collection
- name: Debug output
run: ls -la amarao-ip-${{needs.build.outputs.version }}.tar.gz
- name: Upload collection to galaxy
run: ansible-galaxy collection publish amarao-ip-${{ needs.build.outputs.version }}.tar.gz --api-key="${{ secrets.GALAXY_API_TOKEN }}"