Use community.general as test dependency #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
name: Python application | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
# schedule: | ||
# - cron: "0 4 * * 4" | ||
permissions: | ||
contents: read | ||
# please track https://github.com/ansible-collections/news-for-maintainers/issues/28 | ||
jobs: | ||
'sanity-and-unit-testing': | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
path: ansible_collections/kmpm/incus | ||
# https://github.com/ansible/ansible/issues/72634 | ||
- name: check out community.general since ansible-test can not install dependencies | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ansible-collections/community.general | ||
path: ansible_collections/community/general | ||
- name: create a fake incus cli for use in later testing | ||
run: | | ||
echo '#!/bin/bash' > /usr/local/bin/incus | ||
echo 'echo "incus is currently a fake"' >> /usr/local/bin/incus | ||
echo 'exit 1' >> /usr/local/bin/incus | ||
chmod +x /usr/local/bin/incus | ||
- name: Perform sanity testing with ansible-test | ||
uses: ansible-community/ansible-test-gh-action@release/v1 | ||
with: | ||
# start off with 2.16 and then close in to what https://github.com/ansible-collections/community.general is using | ||
ansible-core-version: stable-2.16 | ||
testing-type: sanity | ||
collection-src-directory: ansible_collections/kmpm/incus | ||
coverage: never | ||
- name: Perform unit testing with ansible-test | ||
uses: ansible-community/ansible-test-gh-action@release/v1 | ||
with: | ||
ansible-core-version: stable-2.16 | ||
testing-type: units | ||
collection-src-directory: ansible_collections/kmpm/incus | ||
coverage: never | ||
# pre-test-cmd: echo This runs before the ansible-test invocation | ||
# target-python-version: 3.11 | ||
# test-deps: >- | ||
# ansible.netcommon | ||
# ansible.utils |