Skip to content

Code Testing

Code Testing #105

Workflow file for this run

---
name: Code Testing
"on":
pull_request:
branches:
- master
paths-ignore:
- "*.md"
- "*version.txt"
- "maintenance/**"
- "docs/**"
- ".github/**"
- "!.github/**/*test*.yml"
- "!.github/**/*constraints*.txt"
- "!.github/**/*requirements*.txt"
- "!.github/**/*env*.txt"
# - "!.github/**/*release*.yml"
schedule:
- cron: "0 7 * * 5" # At 07:00 on Friday
jobs:
molecule_test:
strategy:
matrix:
molecule_scenario: [
alternative_installation,
check_fails,
default,
postgresql_db,
reconfigure,
upgrade
]
include:
- molecule_scenario: default
ansible_version_minimum: "4.0.0"
name: Molecule Test
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Load environment vars
id: dotenv
uses: falti/dotenv-action@v1.0.2
with:
path: .github/workflows/env_vars.txt
log-variables: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ steps.dotenv.outputs.PYTHON_SETUP_VERSION }}
- name: Upgrade pip
run: |
python3 -m pip install --constraint=.github/workflows/constraints.txt pip
python3 -m pip --version
- name: Install test dependencies
run: |
python3 -m pip install -r .github/workflows/requirements.txt -c .github/workflows/constraints.txt
molecule --version
docker --version
ansible-galaxy install --timeout 120 --verbose -r requirements.yml
ansible-galaxy collection list
- if: ${{ matrix.ansible_version_minimum }}
run: |
python3 -m pip install --force-reinstall ansible==${{ matrix.ansible_version_minimum }}
molecule --version
ansible-galaxy collection list
- name: Run Molecule tests
run: molecule test --scenario-name ${{ matrix.molecule_scenario }}
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
TEST_MOLECULE_LINT: false
GH_TOKEN: ${{ secrets.GH_TOKEN }}