Skip to content

Commit

Permalink
Add release drafter workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignacio Bolonio committed Jan 3, 2024
1 parent ea003a8 commit 1906aa9
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ jobs:
- run: make lint

- run: make coverage
if: github.ref != 'refs/heads/master'

- run: make coverage-master
if: github.ref == 'refs/heads/master'
32 changes: 32 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master
# pull_request event is required only for autolabeler
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]
# pull_request_target event is required for autolabeler to support PRs from forks
pull_request_target:
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ coverage:
coverage xml -i -o build/coverage.xml
coverage html

coverage-master:
coverage run --source=pycfmodel --branch -m pytest tests/ --junitxml=build/test.xml -v -m "not actions"
coverage report
coverage xml -i -o build/coverage.xml
coverage html

test: lint unit

test-docs:
Expand Down
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,9 @@ indent-style = "space"
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
line-ending = "auto"

[tool.pytest.ini_options]
markers = [
"actions: marks tests that checks the full list of IAM actions (deselect with '-m \"not actions\"')",
]
2 changes: 2 additions & 0 deletions tests/test_constants.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import json

import httpx
import pytest

from pycfmodel.cloudformation_actions import CLOUDFORMATION_ACTIONS


@pytest.mark.actions
def test_cloudformation_actions():
response = httpx.get("https://awspolicygen.s3.amazonaws.com/js/policies.js")
response.raise_for_status()
Expand Down

0 comments on commit 1906aa9

Please sign in to comment.