Skip to content

Commit

Permalink
Merge pull request #8 from zaro0508/update-ci
Browse files Browse the repository at this point in the history
* Replace CircelCi with GH actions
* Update pre-commit linters

Note: pre-commit poetry-lock linter fails with "Failed to resolve 'pypi.org'".
          can't figure out why so we comment out for now.
  • Loading branch information
zaro0508 authored Jun 18, 2024
2 parents 4a63cec + f46b980 commit 2fd7806
Show file tree
Hide file tree
Showing 7 changed files with 544 additions and 540 deletions.
107 changes: 0 additions & 107 deletions .circleci/config.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### Subject of the issue
Describe your issue here.

### Your environment
* version of sceptre (sceptre --version)
* version of python (python --version)
* which OS/distro

### Steps to reproduce
Tell us how to reproduce this issue. Please provide sceptre projct files if possible,
you can use https://plnkr.co/edit/ANFHm61Ilt4mQVgF as a base.

### Expected behaviour
Tell us what should happen

### Actual behaviour
Tell us what happens instead
21 changes: 21 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[Your PR description here]

## PR Checklist

- [ ] Wrote a good commit message & description [see guide below].
- [ ] Commit message starts with `[Resolve #issue-number]`.
- [ ] Added/Updated unit tests.
- [ ] Added/Updated integration tests (if applicable).
- [ ] All unit tests (`poetry run tox`) are passing.
- [ ] Used the same coding conventions as the rest of the project.
- [ ] The new code passes pre-commit validations (`poetry run pre-commit run --all-files`).
- [ ] The PR relates to _only_ one subject with a clear title.
and description in grammatically correct, complete sentences.

## Approver/Reviewer Checklist

- [ ] Before merge squash related commits.

## Other Information

[Guide to writing a good commit](http://chris.beams.io/posts/git-commit/)
16 changes: 16 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: release

on:
push:
tags:
- 'v*.*.*'

jobs:
pypi-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Publish to pypi
run: poetry publish --build -u __token__ -p ${{ secrets.PYPI_API_TOKEN }}
56 changes: 56 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: tests

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
packaging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
- name: build package
run: poetry build
# use https://github.com/medmunds/tox-gh-matrix to export tox envlist to GH actions
get-tox-envlist:
runs-on: ubuntu-latest
outputs:
envlist: ${{ steps.generate-envlist.outputs.envlist }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --no-interaction --all-extras
- id: generate-envlist
run: poetry run tox --gh-matrix
unit-tests:
needs: get-tox-envlist
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
tox: ${{ fromJSON(needs.get-tox-envlist.outputs.envlist) }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.tox.python.spec }}
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --no-interaction --all-extras
- name: run python tests
run: poetry run tox -e ${{ matrix.tox.name }}
- name: run python test report
run: poetry run tox -e report
29 changes: 16 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@ default_language_version:
python: python3

repos:
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.28.5
hooks:
- id: check-github-workflows
- id: check-github-actions
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.1.0
hooks:
- id: flake8
- repo: https://github.com/adrienverge/yamllint
rev: v1.30.0
rev: v1.35.1
hooks:
- id: yamllint
- repo: https://github.com/awslabs/cfn-python-lint
rev: v0.76.2
rev: v1.2.5.a11
hooks:
- id: cfn-python-lint
args:
Expand All @@ -32,7 +37,7 @@ repos:
^.pre-commit-config.yaml
)
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.4.2
hooks:
- id: black
# It is recommended to specify the latest version of Python
Expand All @@ -41,17 +46,15 @@ repos:
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.10
- repo: https://github.com/python-poetry/poetry
rev: '1.4.0'
rev: '1.8.0'
hooks:
- id: poetry-check
- id: poetry-lock
language_version: python3.10
- repo: https://github.com/AleksaC/circleci-cli-py
rev: v0.1.25638
hooks:
- id: circle-ci-validator
# poetry-lock linter is failing with "Failed to resolve 'pypi.org'"
# not sure why so commenting out for now
# - id: poetry-lock
# language_version: python3.10
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.2.0'
rev: 'v1.10.0'
hooks:
- id: mypy
args: [--ignore-missing-imports]
Expand Down
Loading

0 comments on commit 2fd7806

Please sign in to comment.