-
-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat[ci]: add conventional-commit validation to pull requests
check single commit
- Loading branch information
1 parent
e589278
commit 3adc4e3
Showing
10 changed files
with
189 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# jobs to validate pull request well-formedness | ||
|
||
name: Validate PR metadata | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
permissions: | ||
pull-requests: read | ||
|
||
jobs: | ||
conventional-commit: | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# https://github.com/amannn/action-semantic-pull-request?tab=readme-ov-file#configuration | ||
with: | ||
types: | | ||
feat | ||
fix | ||
chore | ||
refactor | ||
# ci: continuous integration | ||
# docs: documentation | ||
# test: test suite | ||
# lang: language changes | ||
# ux: language changes (UX) | ||
# tool: integration | ||
# ir: (old) IR/codegen changes | ||
# venom: venom changes | ||
scopes: | | ||
ci | ||
docs | ||
test | ||
lang | ||
ux | ||
tool | ||
ir | ||
venom | ||
requireScope: true | ||
subjectPattern: '^(?![A-Z]).+$' | ||
subjectPatternError: | | ||
Starts with uppercase letter: '{subject}' | ||
(Full PR title: '{title}') | ||
headerPattern: '^(\w*)(?:\[([\w$.\-*/ ]*)\])?: (.*)$' | ||
validateSingleCommit: true | ||
validateSingleCommitMatchesPrTitle: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
def test_import_flag_types(make_input_bundle, get_contract): | ||
lib1 = """ | ||
import lib2 | ||
flag Roles: | ||
ADMIN | ||
USER | ||
enum Roles2: | ||
ADMIN | ||
USER | ||
role: Roles | ||
role2: Roles2 | ||
role3: lib2.Roles3 | ||
""" | ||
lib2 = """ | ||
flag Roles3: | ||
ADMIN | ||
USER | ||
NOBODY | ||
""" | ||
contract = """ | ||
import lib1 | ||
initializes: lib1 | ||
@external | ||
def bar(r: lib1.Roles, r2: lib1.Roles2, r3: lib1.lib2.Roles3) -> bool: | ||
lib1.role = r | ||
lib1.role2 = r2 | ||
lib1.role3 = r3 | ||
assert lib1.role == lib1.Roles.ADMIN | ||
assert lib1.role2 == lib1.Roles2.USER | ||
assert lib1.role3 == lib1.lib2.Roles3.NOBODY | ||
return True | ||
""" | ||
|
||
input_bundle = make_input_bundle({"lib1.vy": lib1, "lib2.vy": lib2}) | ||
c = get_contract(contract, input_bundle=input_bundle) | ||
assert c.bar(1, 2, 4) is True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters