Skip to content

Commit

Permalink
releng - prepare 0.6.2 release (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
kapilt authored Sep 1, 2022
1 parent adeacc7 commit 08c03e1
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 222 deletions.
43 changes: 12 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ on:
branches:
- main

permissions: {}

jobs:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.10"
- name: Linting
run: |
pip install pre-commit
Expand All @@ -26,48 +28,27 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9]
python-version: [3.9, "3.10"]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Checkout
uses: actions/checkout@v3

- name: Install poetry
shell: bash
run: |
pip install poetry
- name: Configure poetry
shell: bash
run: poetry config virtualenvs.in-project true
run: pipx install poetry

- name: Set up cache
uses: actions/cache@v1
id: cache
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
shell: bash
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
python-version: "${{ matrix.python-version }}"
cache: "poetry"

- name: Install dependencies
shell: bash
run: poetry install

- name: Pytest run w/ xdist
shell: bash
run: poetry run pytest -v -n auto tests

- name: Coverage run pytest
shell: bash
run: poetry run coverage run --source pytest_terraform -m pytest tests

- name: Coverage Generate XML
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release
on:
push:
tags:
- v*
workflow_dispatch:
inputs: {}

jobs:
Upload:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"

- name: Install dependencies
run: poetry install

- name: Build
run: |
poetry build
md5sum dist/*
- name: Publish
if: startsWith(github.ref, 'refs/tags/')
run:
poetry config http-basic.pypi "__token__" "${{ secrets.PYPI_TOKEN }}"
poetry publish
11 changes: 3 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
exclude: ".(json|md)"
repos:
- repo: https://github.com/psf/black
rev: 19.10b0
rev: 22.3.0
hooks:
- id: black

- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.8
rev: 5.0.4
hooks:
- id: flake8

- repo: https://github.com/timothycrosley/isort
rev: 4.3.21-2
hooks:
- id: isort

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.3.0
hooks:
- id: trailing-whitespace
exclude: ^tests/.*/fixtures/.*
Expand Down
Loading

0 comments on commit 08c03e1

Please sign in to comment.