Skip to content

Commit

Permalink
Migrate CI from circleci to github actions (#6)
Browse files Browse the repository at this point in the history
The Sceptre repo is now using GH actions CI.  We should
move plugin repos over as well.
  • Loading branch information
zaro0508 authored Jan 18, 2024
1 parent 85d4d4d commit 433091a
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 130 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/)
11 changes: 3 additions & 8 deletions .github/workflows/main.yaml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@ name: main

on:
push:
branches:
- '*'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+([0-9]+)'
pull_request:
branches:
- '*'

jobs:
linting:
pypi-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --no-interaction --all-extras
- name: run pre-commit
run: poetry run pre-commit run --all-files --show-diff-on-failure
- name: Publish to pypi
run: poetry publish --build -u __token__ -p ${{ secrets.PYPI_API_TOKEN }}
53 changes: 53 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: tests

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

jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --no-interaction --all-extras
- name: run pre-commit
run: poetry run pre-commit run --all-files --show-diff-on-failure
packaging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --no-interaction --all-extras
- name: build package
run: poetry build
unit-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- 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 py
- name: run python test report
run: poetry run tox -e report
19 changes: 10 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,27 @@ repos:
- "-i=W6001"
exclude: |
(?x)(
^integration-tests/sceptre-project/config/|
^integration-tests/sceptre-project/templates/jinja/|
^tests/fixtures-vpc/config/|
^tests/fixtures/config/|
^temp/|
^.circleci/|
^.github/|
^.pre-commit-config.yaml
)
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.10
- repo: https://github.com/python-poetry/poetry
rev: '1.7.0'
hooks:
- id: poetry-check
- id: poetry-lock
language_version: python3.10
- repo: https://github.com/AleksaC/circleci-cli-py
rev: v0.1.29936
args: ['--check']
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.27.3
hooks:
- id: circle-ci-validator
- id: check-github-workflows
- id: check-github-actions
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11"
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]

[tool.poetry.plugins."sceptre.template_handlers"]
Expand Down
15 changes: 10 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
[tox]
isolated_build = true
envlist = clean,py{38,39,310,311},report
envlist = py{38,39,310,311,312}
skip_missing_interpreters = true

# set for poetry to manages dependencies in tox testenv targets
# (https://python-poetry.org/docs/faq/#usecase-3)

[testenv]
# poetry manages dependencies, not tox (https://python-poetry.org/docs/faq/#usecase-3)
skip_install = true
allowlist_externals = poetry
commands_pre =
poetry install -v
poetry install --all-extras -v
commands =
poetry run pytest {posargs: --cov=template_handler --cov-append --cov-report=term-missing --junitxml=test-reports/junit-{envname}.xml}

[testenv:report]
skip_install = true
allowlist_externals = poetry
ignore_errors = true
fail_under = 90.0
show_missing = true
commands_pre =
poetry install -v
poetry install
commands =
poetry run coverage report
poetry run coverage html
Expand All @@ -25,6 +30,6 @@ commands =
skip_install = true
allowlist_externals = poetry
commands_pre =
poetry install -v
poetry install
commands =
poetry run coverage erase

0 comments on commit 433091a

Please sign in to comment.