Skip to content

Enable prettier format #227

Enable prettier format

Enable prettier format #227

---
# 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/checkout@d632683dd7b4114ad314bca15554477dd762a938 # 4.2.0
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # 5.2.0
with:
python-version: "3.x"
- uses: syphar/restore-virtualenv@e536692e76315a068b4905f792e25febfe6d4391 # 1.3
id: cache-tox-molecule
with:
requirement_files: test-requirements.txt
custom_virtualenv_dir: .tox/molecule
- uses: syphar/restore-pip-download-cache@0b350c2ce930145e820c087e73d5479c2eb44afb # 1.2
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/checkout@d632683dd7b4114ad314bca15554477dd762a938 # 4.2.0
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # 3.0.2
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/checkout@d632683dd7b4114ad314bca15554477dd762a938 # 4.2.0
if: matrix.environment != 'reqs'
- uses: ./.github/actions/molecule-test
if: matrix.environment != 'reqs'
with:
tox-env: ${{ matrix.environment }}