Skip to content

Commit 1906aa9

Browse files
author
Ignacio Bolonio
committed
Add release drafter workflow
1 parent ea003a8 commit 1906aa9

File tree

5 files changed

+50
-1
lines changed

5 files changed

+50
-1
lines changed

Diff for: .github/workflows/lint-and-test.yml

+4
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ jobs:
2626
- run: make lint
2727

2828
- run: make coverage
29+
if: github.ref != 'refs/heads/master'
30+
31+
- run: make coverage-master
32+
if: github.ref == 'refs/heads/master'

Diff for: .github/workflows/release-drafter.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
# branches to consider in the event; optional, defaults to all
6+
branches:
7+
- master
8+
# pull_request event is required only for autolabeler
9+
pull_request:
10+
# Only following types are handled by the action, but one can default to all as well
11+
types: [opened, reopened, synchronize]
12+
# pull_request_target event is required for autolabeler to support PRs from forks
13+
pull_request_target:
14+
types: [opened, reopened, synchronize]
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
update_release_draft:
21+
permissions:
22+
# write permission is required to create a github release
23+
contents: write
24+
# write permission is required for autolabeler
25+
# otherwise, read permission is required at least
26+
pull-requests: write
27+
runs-on: ubuntu-latest
28+
steps:
29+
# Drafts your next Release notes as Pull Requests are merged into "master"
30+
- uses: release-drafter/release-drafter@v5
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Diff for: Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ coverage:
3737
coverage xml -i -o build/coverage.xml
3838
coverage html
3939

40+
coverage-master:
41+
coverage run --source=pycfmodel --branch -m pytest tests/ --junitxml=build/test.xml -v -m "not actions"
42+
coverage report
43+
coverage xml -i -o build/coverage.xml
44+
coverage html
45+
4046
test: lint unit
4147

4248
test-docs:

Diff for: pyproject.toml

+6-1
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,9 @@ indent-style = "space"
7070
skip-magic-trailing-comma = false
7171

7272
# Like Black, automatically detect the appropriate line ending.
73-
line-ending = "auto"
73+
line-ending = "auto"
74+
75+
[tool.pytest.ini_options]
76+
markers = [
77+
"actions: marks tests that checks the full list of IAM actions (deselect with '-m \"not actions\"')",
78+
]

Diff for: tests/test_constants.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import json
22

33
import httpx
4+
import pytest
45

56
from pycfmodel.cloudformation_actions import CLOUDFORMATION_ACTIONS
67

78

9+
@pytest.mark.actions
810
def test_cloudformation_actions():
911
response = httpx.get("https://awspolicygen.s3.amazonaws.com/js/policies.js")
1012
response.raise_for_status()

0 commit comments

Comments
 (0)