Skip to content

Upgrade test-requirements #220

Upgrade test-requirements

Upgrade test-requirements #220

---
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2021
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
name: Check All Molecule tests
# yamllint disable-line rule:truthy
on:
push:
paths:
- galaxy-requirements.yml
- test-requirements.txt
- playbooks/roles/**
pull_request_review:
types:
- submitted
jobs:
bootstrap:
name: Pull python dependencies
runs-on: macos-12
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: '3.x'
- uses: syphar/[email protected]
id: cache-tox-molecule
with:
requirement_files: test-requirements.txt
custom_virtualenv_dir: .tox/molecule
- uses: syphar/[email protected]
if: steps.cache-tox-molecule.outputs.cache-hit != 'true'
with:
requirement_files: test-requirements.txt
- run: pip install -r test-requirements.txt
if: steps.cache-tox-molecule.outputs.cache-hit != 'true'
changes:
runs-on: ubuntu-latest
if: >-
(
github.event_name == 'pull_request_review' &&
github.event.review.state == 'approved'
) || github.event_name != 'pull_request_review'
needs: bootstrap
outputs:
environments: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/[email protected]
- uses: dorny/[email protected]
if: ${{ !env.ACT }}
id: filter
with:
token: ${{ secrets.GITHUB_TOKEN }}
filters: |
reqs: &reqs
- galaxy-requirements.yml
- test-requirements.txt
nfd:
- *reqs
- 'playbooks/roles/nfd/**'
pmem:
- *reqs
- 'playbooks/roles/pmem/**'
qat_driver:
- *reqs
- 'playbooks/roles/qat_driver/**'
sriov_cni:
- *reqs
- 'playbooks/roles/sriov_cni/**'
sriov_plugin:
- *reqs
- 'playbooks/roles/sriov_plugin/**'
criproxy:
- *reqs
- 'playbooks/roles/criproxy/**'
check-molecule:
name: Check Ansible role with Molecule tests
needs: changes
strategy:
fail-fast: false
matrix:
environment: ${{ fromJSON(needs.changes.outputs.environments) }}
runs-on: macos-12
steps:
- uses: actions/[email protected]
if: matrix.environment != 'reqs'
- uses: ./.github/actions/molecule-test
if: matrix.environment != 'reqs'
with:
tox-env: ${{ matrix.environment }}