1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00
ansible-podman-collections/.github/workflows/collection-continuous-integration.yml
dependabot[bot] 65d9d49aa4
Bump actions/checkout from 3 to 4 (#641)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 11:29:22 +03:00

120 lines
4 KiB
YAML

name: Collection build and tests
on:
push:
pull_request:
schedule:
- cron: 3 0 * * * # Run daily at 0:03 UTC
jobs:
build-collection-artifact:
name: Build
runs-on: ${{ matrix.runner-os }}
strategy:
matrix:
runner-os:
- ubuntu-22.04
ansible-version:
- git+https://github.com/ansible/ansible.git@stable-2.15
runner-python-version:
- 3.9
steps:
- name: Check out ${{ github.repository }} on disk
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.runner-python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.runner-python-version }}
- name: Set up pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tests/sanity/requirements.txt') }}-${{ hashFiles('tests/unit/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- 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@v3
with:
name: collection
path: .cache/collection-tarballs
sanity-test-collection-via-containers:
name: Sanity in container via Py-${{ matrix.python-version }} & ${{ matrix.ansible-version }}
needs:
- build-collection-artifact
runs-on: ${{ matrix.runner-os }}
strategy:
fail-fast: false
matrix:
runner-os:
- ubuntu-22.04
runner-python-version:
- 3.9
ansible-version:
- ansible<2.10
- git+https://github.com/ansible/ansible.git@stable-2.15
- git+https://github.com/ansible/ansible.git@devel
python-version:
- 3.9
include:
- runner-os: ubuntu-22.04
runner-python-version: '3.10'
ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: '3.10'
- runner-os: ubuntu-22.04
runner-python-version: 3.8
ansible-version: ansible<2.10
python-version: 3.8
exclude:
- runner-os: ubuntu-22.04
runner-python-version: 3.9
ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: 3.9
- runner-os: ubuntu-22.04
runner-python-version: 3.9
ansible-version: ansible<2.10
python-version: 3.9
steps:
- name: Set up Python ${{ matrix.runner-python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.runner-python-version }}
- name: Set up pip cache
uses: actions/cache@v3
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@v3
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
--python "${{ matrix.python-version }}" -vvv
plugins/ tests/
working-directory: >-
/home/runner/.ansible/collections/ansible_collections/containers/podman
# When we have unit tests, add them here