Skip to content

Commit

Permalink
base structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ansibleguy committed Jan 14, 2024
1 parent 132d771 commit 5c76814
Show file tree
Hide file tree
Showing 34 changed files with 1,816 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---

name: Lint

on:
push:
branches: [latest]
paths:
- '**.py'
- '**.yml'
- '.github/workflows/lint.yml'
- 'requirements_lint.txt'
pull_request:
branches: [latest]
paths:
- '**.py'
- '**.yml'
- '.github/workflows/lint.yml'
- 'requirements_lint.txt'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}

- name: Install python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: pip install -r requirements_lint.txt
shell: bash

- name: Running PyLint
run: |
pylint --version
pylint --recursive=y .
shell: bash

- name: Running YamlLint
run: |
yamllint --version
yamllint .
shell: bash

43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---

on:
push:
tags:
- '*'

jobs:
publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}

- name: Install python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: pip install -r requirements_build.txt
shell: bash

- name: Extract tag name
id: version
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3 | cut -c 2-)

- name: Update version in setup.py
run: >-
sed -i 's/version=.*/version="${{ steps.version.outputs.TAG_NAME }}",/g' setup.py
- name: Building
run: python3 -m build
shell: bash

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---

name: Test

on:
push:
branches: [latest]
paths:
- '**.py'
- '.github/workflows/test.yml'
- 'requirements_test.txt'
pull_request:
branches: [latest]
paths:
- '**.py'
- '**.yml'
- '.github/workflows/test.yml'
- 'requirements_test.txt'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 1

steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}

- name: Install python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: pip install -r requirements_test.txt
shell: bash

- name: Running Tests
run: python3 -m pytest
shell: bash
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea/
dist/
venv/
ansible_webui.egg-info/
Loading

0 comments on commit 5c76814

Please sign in to comment.