combinatory-synthesizer 0.0.1.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- combinatory_synthesizer-0.0.1.dev2/.github/dependabot.yml +6 -0
- combinatory_synthesizer-0.0.1.dev2/.github/workflows/benchmarks.yml +89 -0
- combinatory_synthesizer-0.0.1.dev2/.github/workflows/build-nightly.yml +78 -0
- combinatory_synthesizer-0.0.1.dev2/.github/workflows/check-docs.yml +36 -0
- combinatory_synthesizer-0.0.1.dev2/.github/workflows/checks.yml +73 -0
- combinatory_synthesizer-0.0.1.dev2/.github/workflows/deploy-docs.yml +47 -0
- combinatory_synthesizer-0.0.1.dev2/.github/workflows/pr-rules-develop.yml +48 -0
- combinatory_synthesizer-0.0.1.dev2/.github/workflows/pr-rules-main.yml +48 -0
- combinatory_synthesizer-0.0.1.dev2/.github/workflows/pre-release.yml +49 -0
- combinatory_synthesizer-0.0.1.dev2/.github/workflows/release.yml +48 -0
- combinatory_synthesizer-0.0.1.dev2/.gitignore +497 -0
- combinatory_synthesizer-0.0.1.dev2/CITATION.cff +38 -0
- combinatory_synthesizer-0.0.1.dev2/LICENSE.txt +73 -0
- combinatory_synthesizer-0.0.1.dev2/PKG-INFO +84 -0
- combinatory_synthesizer-0.0.1.dev2/README.md +64 -0
- combinatory_synthesizer-0.0.1.dev2/benchmarks/__init__.py +0 -0
- combinatory_synthesizer-0.0.1.dev2/benchmarks/test_benchmark_maximal_elements.py +28 -0
- combinatory_synthesizer-0.0.1.dev2/benchmarks/test_benchmark_maze.py +74 -0
- combinatory_synthesizer-0.0.1.dev2/benchmarks/test_benchmark_maze_contains.py +90 -0
- combinatory_synthesizer-0.0.1.dev2/benchmarks/test_benchmark_maze_loopfree.py +91 -0
- combinatory_synthesizer-0.0.1.dev2/docs/.overrides/partials/copyright.html +24 -0
- combinatory_synthesizer-0.0.1.dev2/docs/about/authors.md +13 -0
- combinatory_synthesizer-0.0.1.dev2/docs/assets/badges/mypy.json +7 -0
- combinatory_synthesizer-0.0.1.dev2/docs/assets/images/logo.svg +96 -0
- combinatory_synthesizer-0.0.1.dev2/docs/bibliographies/applications.bib +90 -0
- combinatory_synthesizer-0.0.1.dev2/docs/bibliographies/theory.bib +187 -0
- combinatory_synthesizer-0.0.1.dev2/docs/examples/introduction.md +3 -0
- combinatory_synthesizer-0.0.1.dev2/docs/features/advanced.md +2 -0
- combinatory_synthesizer-0.0.1.dev2/docs/features/constraints.md +109 -0
- combinatory_synthesizer-0.0.1.dev2/docs/guidelines/best-practice.md +2 -0
- combinatory_synthesizer-0.0.1.dev2/docs/guidelines/troubleshoot.md +5 -0
- combinatory_synthesizer-0.0.1.dev2/docs/index.md +273 -0
- combinatory_synthesizer-0.0.1.dev2/docs/quick-start.md +99 -0
- combinatory_synthesizer-0.0.1.dev2/docs/stylesheets/extra.css +18 -0
- combinatory_synthesizer-0.0.1.dev2/examples/example_constraints.py +105 -0
- combinatory_synthesizer-0.0.1.dev2/examples/example_constraints_inline.py +63 -0
- combinatory_synthesizer-0.0.1.dev2/examples/example_fibonacci.py +91 -0
- combinatory_synthesizer-0.0.1.dev2/examples/example_fibonacci_linear.py +91 -0
- combinatory_synthesizer-0.0.1.dev2/hatch.toml +49 -0
- combinatory_synthesizer-0.0.1.dev2/mkdocs.yml +127 -0
- combinatory_synthesizer-0.0.1.dev2/pyproject.toml +99 -0
- combinatory_synthesizer-0.0.1.dev2/scripts/gen_example_pages.py +46 -0
- combinatory_synthesizer-0.0.1.dev2/scripts/gen_reference_pages.py +33 -0
- combinatory_synthesizer-0.0.1.dev2/src/cosy/__init__.py +19 -0
- combinatory_synthesizer-0.0.1.dev2/src/cosy/_version.py +34 -0
- combinatory_synthesizer-0.0.1.dev2/src/cosy/combinatorics.py +89 -0
- combinatory_synthesizer-0.0.1.dev2/src/cosy/inspector.py +152 -0
- combinatory_synthesizer-0.0.1.dev2/src/cosy/maestro.py +67 -0
- combinatory_synthesizer-0.0.1.dev2/src/cosy/py.typed +0 -0
- combinatory_synthesizer-0.0.1.dev2/src/cosy/solution_space.py +365 -0
- combinatory_synthesizer-0.0.1.dev2/src/cosy/specification_builder.py +159 -0
- combinatory_synthesizer-0.0.1.dev2/src/cosy/subtypes.py +167 -0
- combinatory_synthesizer-0.0.1.dev2/src/cosy/synthesizer.py +394 -0
- combinatory_synthesizer-0.0.1.dev2/src/cosy/tree.py +138 -0
- combinatory_synthesizer-0.0.1.dev2/src/cosy/types.py +284 -0
- combinatory_synthesizer-0.0.1.dev2/tests/__init__.py +0 -0
- combinatory_synthesizer-0.0.1.dev2/tests/test_combinatorics.py +83 -0
- combinatory_synthesizer-0.0.1.dev2/tests/test_contains_tree.py +79 -0
- combinatory_synthesizer-0.0.1.dev2/tests/test_group_underspecification.py +32 -0
- combinatory_synthesizer-0.0.1.dev2/tests/test_infinite_enumeration.py +81 -0
- combinatory_synthesizer-0.0.1.dev2/tests/test_intersect_arguments.py +27 -0
- combinatory_synthesizer-0.0.1.dev2/tests/test_literal_candidates.py +138 -0
- combinatory_synthesizer-0.0.1.dev2/tests/test_literal_inference.py +99 -0
- combinatory_synthesizer-0.0.1.dev2/tests/test_no_prune.py +32 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
name: Perform Benchmarks
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- develop
|
|
8
|
+
pull_request:
|
|
9
|
+
branches:
|
|
10
|
+
- main
|
|
11
|
+
- develop
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: benchmarks-${{ github.event_name }}-${{ github.ref }}
|
|
16
|
+
cancel-in-progress: true
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
env:
|
|
20
|
+
PYTHONUNBUFFERED: "1"
|
|
21
|
+
FORCE_COLOR: "1"
|
|
22
|
+
BRANCH_NAME: ${{ github.base_ref || github.ref_name }}
|
|
23
|
+
PUSH_TO_BENCHMARKS: false
|
|
24
|
+
COMMENT_ALWAYS: true
|
|
25
|
+
|
|
26
|
+
jobs:
|
|
27
|
+
benchmark-then-upload:
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/create-github-app-token@v2
|
|
31
|
+
id: tudo-seal-workflow-token
|
|
32
|
+
with:
|
|
33
|
+
app-id: ${{ secrets.TUDO_SEAL_WORKFLOW_CLIENT_ID }}
|
|
34
|
+
private-key: ${{ secrets.TUDO_SEAL_WORKFLOW_PRIVATE_KEY }}
|
|
35
|
+
repositories: |
|
|
36
|
+
cosy
|
|
37
|
+
cosy-benchmarks
|
|
38
|
+
|
|
39
|
+
- uses: actions/checkout@v5
|
|
40
|
+
with:
|
|
41
|
+
repository: tudo-seal/cosy-benchmarks
|
|
42
|
+
token: ${{ steps.tudo-seal-workflow-token.outputs.token }}
|
|
43
|
+
ref: 'gh-pages'
|
|
44
|
+
|
|
45
|
+
- uses: actions/checkout@v5
|
|
46
|
+
with:
|
|
47
|
+
# Full history for timestamps
|
|
48
|
+
fetch-depth: 0
|
|
49
|
+
token: ${{ steps.tudo-seal-workflow-token.outputs.token }}
|
|
50
|
+
path: 'cosy-nested'
|
|
51
|
+
|
|
52
|
+
- name: Set up Python
|
|
53
|
+
uses: actions/setup-python@v6
|
|
54
|
+
with:
|
|
55
|
+
python-version: '3.13'
|
|
56
|
+
|
|
57
|
+
- name: Install Hatch
|
|
58
|
+
uses: pypa/hatch@install
|
|
59
|
+
|
|
60
|
+
- name: Run Benchmark Suite
|
|
61
|
+
run: hatch test benchmarks --benchmark-json benchmarks.json
|
|
62
|
+
working-directory: 'cosy-nested'
|
|
63
|
+
|
|
64
|
+
- name: Config Git
|
|
65
|
+
run: |
|
|
66
|
+
git config user.name "tudo-seal-workflows[bot]"
|
|
67
|
+
git config user.email "244727884+tudo-seal-workflows[bot]@users.noreply.github.com"
|
|
68
|
+
|
|
69
|
+
- name: Determine Push Or Not
|
|
70
|
+
if: github.event_name != 'pull_request'
|
|
71
|
+
run: |
|
|
72
|
+
echo "PUSH_TO_BENCHMARKS=true" >> $GITHUB_ENV
|
|
73
|
+
echo "COMMENT_ALWAYS=false" >> $GITHUB_ENV
|
|
74
|
+
|
|
75
|
+
- name: Store Benchmark Result
|
|
76
|
+
uses: benchmark-action/github-action-benchmark@v1
|
|
77
|
+
with:
|
|
78
|
+
name: Benchmark CoSy
|
|
79
|
+
tool: 'pytest'
|
|
80
|
+
output-file-path: cosy-nested/benchmarks.json
|
|
81
|
+
github-token: ${{ steps.tudo-seal-workflow-token.outputs.token }}
|
|
82
|
+
auto-push: ${{ env.PUSH_TO_BENCHMARKS }}
|
|
83
|
+
alert-threshold: '300%'
|
|
84
|
+
comment-on-alert: true
|
|
85
|
+
fail-on-alert: true
|
|
86
|
+
comment-always: ${{ env.COMMENT_ALWAYS }}
|
|
87
|
+
summary-always: true
|
|
88
|
+
gh-repository: 'github.com/tudo-seal/cosy-benchmarks'
|
|
89
|
+
benchmark-data-dir-path: '${{ env.BRANCH_NAME }}/benchmarks'
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
name: "Nightly Build"
|
|
2
|
+
on:
|
|
3
|
+
schedule:
|
|
4
|
+
- cron: "0 0 * * *"
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
|
|
7
|
+
env:
|
|
8
|
+
nightly_tag: "nightly"
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build-nightly:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
if: github.ref == 'refs/heads/develop'
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/create-github-app-token@v2
|
|
16
|
+
id: tudo-seal-workflow-token
|
|
17
|
+
with:
|
|
18
|
+
app-id: ${{ secrets.TUDO_SEAL_WORKFLOW_CLIENT_ID }}
|
|
19
|
+
private-key: ${{ secrets.TUDO_SEAL_WORKFLOW_PRIVATE_KEY }}
|
|
20
|
+
|
|
21
|
+
- uses: actions/checkout@v5
|
|
22
|
+
with:
|
|
23
|
+
# Full history for timestamps
|
|
24
|
+
fetch-depth: 0
|
|
25
|
+
token: ${{ steps.tudo-seal-workflow-token.outputs.token }}
|
|
26
|
+
|
|
27
|
+
- name: Date and Hash
|
|
28
|
+
run: |
|
|
29
|
+
echo "DATESTAMP=$(date +'%d.%m.%Y')" >> $GITHUB_ENV
|
|
30
|
+
echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
|
31
|
+
|
|
32
|
+
- name: Set up Python
|
|
33
|
+
uses: actions/setup-python@v6
|
|
34
|
+
with:
|
|
35
|
+
python-version: '3.12'
|
|
36
|
+
|
|
37
|
+
- name: Install Hatch
|
|
38
|
+
uses: pypa/hatch@install
|
|
39
|
+
|
|
40
|
+
- name: Display Version
|
|
41
|
+
run: echo "NIGHTLY_VERSION=$(hatch version)" >> $GITHUB_ENV
|
|
42
|
+
|
|
43
|
+
- name: Build Package
|
|
44
|
+
run: hatch build
|
|
45
|
+
|
|
46
|
+
- name: Convert nightly to draft
|
|
47
|
+
run: gh release edit --draft "${{ env.nightly_tag }}" || true
|
|
48
|
+
env:
|
|
49
|
+
GH_TOKEN: ${{ steps.tudo-seal-workflow-token.outputs.token }}
|
|
50
|
+
|
|
51
|
+
- name: Move nightly tag to current HEAD
|
|
52
|
+
run: |
|
|
53
|
+
git config user.name "tudo-seal-workflows[bot]"
|
|
54
|
+
git config user.email "244727884+tudo-seal-workflows[bot]@users.noreply.github.com"
|
|
55
|
+
git tag -d ${{ env.nightly_tag }} || true
|
|
56
|
+
git push origin :refs/tags/${{ env.nightly_tag }} || true
|
|
57
|
+
git tag ${{ env.nightly_tag }}
|
|
58
|
+
git push origin ${{ env.nightly_tag }}
|
|
59
|
+
env:
|
|
60
|
+
GH_TOKEN: ${{ steps.tudo-seal-workflow-token.outputs.token }}
|
|
61
|
+
|
|
62
|
+
- name: Publish nightly on GitHub
|
|
63
|
+
run: |
|
|
64
|
+
while IFS= read -r line; do
|
|
65
|
+
gh release delete-asset "${{ env.nightly_tag }}" "$line"
|
|
66
|
+
done <<< "$(gh release view "${{ env.nightly_tag }}" --json assets --jq .assets[].name)"
|
|
67
|
+
gh release edit \
|
|
68
|
+
--verify-tag \
|
|
69
|
+
--title "Nightly@${{ env.NIGHTLY_VERSION }}" \
|
|
70
|
+
--notes "Nightly build of ''develop'', currently at ${{ env.COMMIT_HASH }}, built on ${{ env.DATESTAMP }}." \
|
|
71
|
+
--draft=false \
|
|
72
|
+
"${{ env.nightly_tag }}"
|
|
73
|
+
gh release upload --clobber "${{ env.nightly_tag }}" $ARTIFACTS
|
|
74
|
+
env:
|
|
75
|
+
GH_TOKEN: ${{ steps.tudo-seal-workflow-token.outputs.token }}
|
|
76
|
+
ARTIFACTS: >
|
|
77
|
+
dist/combinatory_synthesizer-${{ env.NIGHTLY_VERSION }}.tar.gz
|
|
78
|
+
dist/combinatory_synthesizer-${{ env.NIGHTLY_VERSION }}-py3-none-any.whl
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: Check Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
- develop
|
|
9
|
+
pull_request:
|
|
10
|
+
branches:
|
|
11
|
+
- main
|
|
12
|
+
- develop
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: check-docs-${{ github.event_name }}-${{ github.ref }}
|
|
16
|
+
cancel-in-progress: true
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
check-docs:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v5
|
|
23
|
+
with:
|
|
24
|
+
# Full history for timestamps
|
|
25
|
+
fetch-depth: 0
|
|
26
|
+
|
|
27
|
+
- name: Set up Python
|
|
28
|
+
uses: actions/setup-python@v6
|
|
29
|
+
with:
|
|
30
|
+
python-version: '3.12'
|
|
31
|
+
|
|
32
|
+
- name: Install Hatch
|
|
33
|
+
uses: pypa/hatch@install
|
|
34
|
+
|
|
35
|
+
- name: Build and Check
|
|
36
|
+
run: hatch run docs:check
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: Perform Checks
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
- develop
|
|
9
|
+
pull_request:
|
|
10
|
+
branches:
|
|
11
|
+
- main
|
|
12
|
+
- develop
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
concurrency:
|
|
16
|
+
group: checks-${{ github.event_name }}-${{ github.ref }}
|
|
17
|
+
cancel-in-progress: true
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
env:
|
|
21
|
+
PYTHONUNBUFFERED: "1"
|
|
22
|
+
FORCE_COLOR: "1"
|
|
23
|
+
BRANCH_NAME: ${{ github.base_ref || github.ref_name }}
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
test-lint-type-coverage:
|
|
27
|
+
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
|
|
28
|
+
runs-on: ${{ matrix.os }}
|
|
29
|
+
env:
|
|
30
|
+
OS: ${{ matrix.os }}
|
|
31
|
+
PYTHON: ${{ matrix.python-version }}
|
|
32
|
+
strategy:
|
|
33
|
+
fail-fast: false
|
|
34
|
+
matrix:
|
|
35
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
36
|
+
python-version: ['3.10', '3.11', '3.12', '3.13']
|
|
37
|
+
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v5
|
|
40
|
+
|
|
41
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
42
|
+
uses: actions/setup-python@v6
|
|
43
|
+
with:
|
|
44
|
+
python-version: ${{ matrix.python-version }}
|
|
45
|
+
|
|
46
|
+
- name: Install Hatch
|
|
47
|
+
uses: pypa/hatch@install
|
|
48
|
+
|
|
49
|
+
- name: Run static analysis
|
|
50
|
+
run: hatch fmt --check
|
|
51
|
+
|
|
52
|
+
- name: Run type checks
|
|
53
|
+
run: hatch run types:check
|
|
54
|
+
|
|
55
|
+
- name: Run tests
|
|
56
|
+
run: hatch test tests --python ${{ matrix.python-version }} --cov --cov-branch --cov-report=xml --randomize --parallel --junit-xml=report.xml
|
|
57
|
+
|
|
58
|
+
- name: Upload Tests to Codecov
|
|
59
|
+
if: ${{ !cancelled() && !contains( github.head_ref, 'hotfix/')}}
|
|
60
|
+
uses: codecov/codecov-action@v5
|
|
61
|
+
with:
|
|
62
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
63
|
+
files: ./report.xml
|
|
64
|
+
report_type: test_results
|
|
65
|
+
flags: ${{ matrix.os }}-${{ matrix.python-version }}
|
|
66
|
+
|
|
67
|
+
- name: Upload Coverage to Codecov
|
|
68
|
+
uses: codecov/codecov-action@v5
|
|
69
|
+
if: ${{ !contains( github.head_ref, 'hotfix/') }}
|
|
70
|
+
with:
|
|
71
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
72
|
+
files: ./coverage.xml
|
|
73
|
+
flags: ${{ matrix.os }}-${{ matrix.python-version }}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Deploy Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- v*
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
pages: write
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: deploy-docs
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
pre-deploy-docs-checks:
|
|
19
|
+
uses: ./.github/workflows/check-docs.yml
|
|
20
|
+
|
|
21
|
+
deploy-docs:
|
|
22
|
+
needs: [pre-deploy-docs-checks]
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v5
|
|
26
|
+
with:
|
|
27
|
+
# Full history for timestamps
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
|
|
30
|
+
- name: Set up Python
|
|
31
|
+
uses: actions/setup-python@v6
|
|
32
|
+
with:
|
|
33
|
+
python-version: '3.12'
|
|
34
|
+
|
|
35
|
+
- name: Install Hatch
|
|
36
|
+
uses: pypa/hatch@install
|
|
37
|
+
|
|
38
|
+
- name: Display Version
|
|
39
|
+
run: hatch version
|
|
40
|
+
|
|
41
|
+
- name: Configure Git for Actions
|
|
42
|
+
run: |
|
|
43
|
+
git config --local user.name 'tudo-seal-workflows[bot]'
|
|
44
|
+
git config --local user.email '244727884+tudo-seal-workflows[bot]@users.noreply.github.com'
|
|
45
|
+
|
|
46
|
+
- name: Publish
|
|
47
|
+
run: hatch run docs:deploy
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: 'Check PR Rules for Develop'
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
types: [ opened, reopened ]
|
|
6
|
+
branches:
|
|
7
|
+
- develop
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
PR_NUMBER: ${{ github.event.number }}
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
pr-rules-develop:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
checks: write
|
|
17
|
+
pull-requests: write
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/create-github-app-token@v2
|
|
20
|
+
id: tudo-seal-workflow-token
|
|
21
|
+
with:
|
|
22
|
+
app-id: ${{ secrets.TUDO_SEAL_WORKFLOW_CLIENT_ID }}
|
|
23
|
+
private-key: ${{ secrets.TUDO_SEAL_WORKFLOW_PRIVATE_KEY }}
|
|
24
|
+
|
|
25
|
+
- uses: actions/checkout@v5
|
|
26
|
+
with:
|
|
27
|
+
# Full history for timestamps
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
token: ${{ steps.tudo-seal-workflow-token.outputs.token }}
|
|
30
|
+
|
|
31
|
+
- name: Close Pull Request and Comment if Violating
|
|
32
|
+
if: ${{ !contains( github.head_ref, 'feature/') && !contains( github.head_ref, 'bugfix/') && !contains( github.head_ref, 'dependabot/github_actions/') && !contains( github.head_ref, 'main')}}
|
|
33
|
+
run: |
|
|
34
|
+
gh pr comment ${{ env.PR_NUMBER }} --body ":warning: You can only merge to develop from a feature or a bugfix branch. :warning:"
|
|
35
|
+
gh pr close ${{ env.PR_NUMBER }}
|
|
36
|
+
env:
|
|
37
|
+
GH_TOKEN: ${{ steps.tudo-seal-workflow-token.outputs.token }}
|
|
38
|
+
|
|
39
|
+
- name: Fail Job if Violating
|
|
40
|
+
if: ${{ !contains( github.head_ref, 'feature/') && !contains( github.head_ref, 'bugfix/') && !contains( github.head_ref, 'dependabot/github_actions/') && !contains( github.head_ref, 'main')}}
|
|
41
|
+
run: |
|
|
42
|
+
echo "Reason: You can only merge to develop from a feature or a bugfix branch."
|
|
43
|
+
exit 1
|
|
44
|
+
|
|
45
|
+
- name: Succeed Job if not Violating
|
|
46
|
+
if: ${{ contains( github.head_ref, 'feature/') || contains( github.head_ref, 'bugfix/') || contains( github.head_ref, 'dependabot/github_actions/') && !contains( github.head_ref, 'main')}}
|
|
47
|
+
run: |
|
|
48
|
+
exit 0
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: 'Check PR Rules for Main'
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
types: [ opened, reopened ]
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
PR_NUMBER: ${{ github.event.number }}
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
pr-rules-main:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
checks: write
|
|
17
|
+
pull-requests: write
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/create-github-app-token@v2
|
|
20
|
+
id: tudo-seal-workflow-token
|
|
21
|
+
with:
|
|
22
|
+
app-id: ${{ secrets.TUDO_SEAL_WORKFLOW_CLIENT_ID }}
|
|
23
|
+
private-key: ${{ secrets.TUDO_SEAL_WORKFLOW_PRIVATE_KEY }}
|
|
24
|
+
|
|
25
|
+
- uses: actions/checkout@v5
|
|
26
|
+
with:
|
|
27
|
+
# Full history for timestamps
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
token: ${{ steps.tudo-seal-workflow-token.outputs.token }}
|
|
30
|
+
|
|
31
|
+
- name: Close Pull Request and Comment if Violating
|
|
32
|
+
if: ${{ !contains( github.head_ref, 'release/') && !contains( github.head_ref, 'hotfix/')}}
|
|
33
|
+
run: |
|
|
34
|
+
gh pr comment ${{ env.PR_NUMBER }} --body ":warning: You can only merge to main from a release or a hotfix branch. :warning:"
|
|
35
|
+
gh pr close ${{ env.PR_NUMBER }}
|
|
36
|
+
env:
|
|
37
|
+
GH_TOKEN: ${{ steps.tudo-seal-workflow-token.outputs.token }}
|
|
38
|
+
|
|
39
|
+
- name: Fail Job if Violating
|
|
40
|
+
if: ${{ !contains( github.head_ref, 'release/') && !contains( github.head_ref, 'hotfix/')}}
|
|
41
|
+
run: |
|
|
42
|
+
echo "Reason: You can only merge to main from a release or a hotfix branch."
|
|
43
|
+
exit 1
|
|
44
|
+
|
|
45
|
+
- name: Succeed Job if not Violating
|
|
46
|
+
if: ${{ contains( github.head_ref, 'release/') || contains( github.head_ref, 'hotfix/')}}
|
|
47
|
+
run: |
|
|
48
|
+
exit 0
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: Pre-release CoSy
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
permissions:
|
|
7
|
+
id-token: write
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: pre-release
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
pre-release-checks:
|
|
15
|
+
if: github.ref == 'refs/heads/develop'
|
|
16
|
+
uses: ./.github/workflows/checks.yml
|
|
17
|
+
|
|
18
|
+
pre-release-pypi:
|
|
19
|
+
if: github.ref == 'refs/heads/develop'
|
|
20
|
+
needs: [pre-release-checks]
|
|
21
|
+
environment: pre-release
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v5
|
|
25
|
+
with:
|
|
26
|
+
# Full history for timestamps
|
|
27
|
+
fetch-depth: 0
|
|
28
|
+
|
|
29
|
+
- name: Set up Python
|
|
30
|
+
uses: actions/setup-python@v6
|
|
31
|
+
with:
|
|
32
|
+
python-version: '3.12'
|
|
33
|
+
|
|
34
|
+
- name: Install Hatch
|
|
35
|
+
uses: pypa/hatch@install
|
|
36
|
+
|
|
37
|
+
- name: Check for Dev
|
|
38
|
+
run: |
|
|
39
|
+
hatch_version="$(hatch version)"
|
|
40
|
+
if [[ ! $hatch_version =~ "dev" ]]; then
|
|
41
|
+
exit 1
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
- name: Build Package
|
|
45
|
+
run: hatch build
|
|
46
|
+
|
|
47
|
+
# Uses OpenID Connect
|
|
48
|
+
- name: Publish Package
|
|
49
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: Release CoSy
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- v*
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: release
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
pre-release-checks:
|
|
18
|
+
uses: ./.github/workflows/checks.yml
|
|
19
|
+
|
|
20
|
+
release-pypi:
|
|
21
|
+
needs: [pre-release-checks]
|
|
22
|
+
environment: release
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v5
|
|
26
|
+
with:
|
|
27
|
+
# Full history for timestamps
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
|
|
30
|
+
- name: Set up Python
|
|
31
|
+
uses: actions/setup-python@v6
|
|
32
|
+
with:
|
|
33
|
+
python-version: '3.12'
|
|
34
|
+
|
|
35
|
+
- name: Install Hatch
|
|
36
|
+
uses: pypa/hatch@install
|
|
37
|
+
|
|
38
|
+
- name: Display Version
|
|
39
|
+
run: hatch version
|
|
40
|
+
|
|
41
|
+
- name: Build Package
|
|
42
|
+
run: hatch build
|
|
43
|
+
|
|
44
|
+
# Uses OpenID Connect
|
|
45
|
+
- name: Publish Package
|
|
46
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
47
|
+
with:
|
|
48
|
+
repository-url: https://test.pypi.org/legacy/
|