Skip to content

Fix vermin build step #49

Fix vermin build step

Fix vermin build step #49

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: CI Tests
on:
push:
pull_request:
types: [opened, reopened]
workflow_dispatch:
jobs:
unit-tests:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-versions: ['3.6']
steps:
- uses: actions/checkout@v4 # https://github.com/actions/cache/releases
- name: Set up Python ${{ matrix.python-versions }}
uses: actions/setup-python@v5 # https://github.com/actions/setup-python/releases
with:
python-version: ${{ matrix.python-versions }}
- name: Install Pipenv
run: |
python -m pip install --upgrade pip
python -m pip install pipenv
- name: Install Dev Packages
run: |
pipenv install --deploy --dev
- name: Check minimum required Python version
run: |
pipenv run vermin -q -t=${{ matrix.python-versions }}- --violations cis_audit.py
- name: Check linting with flake8
run: |
pipenv run flake8 *.py tests/*/*.py
- name: Check formatting with black
run: |
pipenv run black --check cis_audit.py tests/*/*.py
- name: Run unit tests with pytest
run: |
pipenv run pytest tests/unit
pipenv run coverage xml
#- name: Codecov
# uses: codecov/codecov-action@v4 # https://github.com/codecov/codecov-action/releases
#
# with:
# files: coverage.xml
integration-tests:
runs-on: macos-latest
needs: unit-tests
strategy:
fail-fast: false
matrix:
os: ['centos7']
if: ${{ false }} # disable for now
steps:
- uses: actions/checkout@v4 # https://github.com/actions/checkout/releases
- name: Cache Vagrant boxes
uses: actions/cache@v4 # https://github.com/actions/cache/releases
with:
path: ~/.vagrant.d/boxes
key: ${{ runner.os }}-vagrant-boxes-${{ hashFiles('Vagrantfile') }}
restore-keys: |
${{ runner.os }}-vagrant-boxes-
- name: Cache Vagrant machines
uses: actions/cache@v4 # https://github.com/actions/cache/releases
with:
path: ~/VirtualBox VMs
key: ${{ runner.os }}-vagrant-machines-${{ hashFiles('Vagrantfile') }}
restore-keys: |
${{ runner.os }}-vagrant-machines-
- name: Show Vagrant version
run: vagrant --version
- name: Run vagrant up
run: vagrant up ${{ matrix.os }}
- name: Run integration tests on ${{ matrix.os }}
run: vagrant ssh ${{ matrix.os }} -c 'cd /vagrant && sudo PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin /root/.local/bin/pytest tests/integration'