Skip to content

Commit

Permalink
Merge pull request #1 from sclorg/add_ga
Browse files Browse the repository at this point in the history
Initial GA, precommits, tox
  • Loading branch information
phracek authored Oct 7, 2024
2 parents 626bcdf + b0e2c4c commit 9aa9c84
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/pre-commit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: pre-commit-tests@Auto-merger

on:
pull_request:
branches:
- main
jobs:
sanity:
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Get sha
id: sha
run: |
echo "::set-output name=SHA::$(git rev-parse HEAD)"
- name: Install needed dependences for sanity checks
id: sched_test
run: |
sudo apt-get update && sudo apt-get -y install curl jq make git shellcheck python3 python3-pip
pip3 install pre-commit
- name: Run Sanity pre-commit tests
continue-on-error: true
id: pre_commit_tests
run: |
set +e
pre-commit run --all
echo ::set-output name=exit_status::$?
26 changes: 26 additions & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
on:
push:
branches:
- main
pull_request:
branches:
- main

name: Run Tox tests on auto-merger

jobs:
tox_test:
name: Tox test
strategy:
matrix:
tox_env: [py36, py37, py38, py39, py310, py311, py312]
# Use GitHub's Linux Docker host
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Tox tests on auto-merger
id: test
uses: fedora-python/tox-github-action@main
with:
tox_env: ${{ matrix.tox_env }}
dnf_install: gcc rpm-devel git python3-devel
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# HOWTO: https://pre-commit.com/#usage
# pip3 install pre-commit
# pre-commit install

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-merge-conflict
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- id: flake8
args:
- --max-line-length=120
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.711
hooks:
- id: mypy
args: [--no-strict-optional, --ignore-missing-imports]
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tox]
skipsdist = True
envlist = py36,py37,py38,py39,py310,py311,py312

[testenv]
commands = python3 -m pytest --color=yes -v --showlocals tests/
deps =
pytest
flexmock

0 comments on commit 9aa9c84

Please sign in to comment.