Skip to content

Commit b6589d7

Browse files
committed
feat: add a Scala wrapper and 2 more tools
1 parent de99586 commit b6589d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1980
-351
lines changed

.github/img/cover.jpg

1.69 MB
Loading

.github/workflows/build_sdist.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: build sdist
2+
3+
on:
4+
pull_request:
5+
workflow_call:
6+
workflow_dispatch:
7+
8+
env:
9+
POETRY_VERSION: 1.8
10+
11+
jobs:
12+
build-sdist:
13+
name: Build source distribution
14+
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
working-directory: python
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: 3.12
25+
26+
- name: Install poetry
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install poetry==${{env.POETRY_VERSION}}
30+
31+
- name: Configure poetry
32+
shell: bash
33+
run: poetry config virtualenvs.in-project true --directory python
34+
35+
- name: Install dependencies
36+
run: poetry install --no-interaction --no-root --without=dev --directory python
37+
38+
- name: Install project
39+
run: poetry install --no-interaction --without=dev --directory python
40+
41+
- name: Build package
42+
run: poetry build --format=sdist --directory python
43+
44+
- name: Upload sdist
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: tp53-sdist
48+
path: dist/*.tar.gz
49+
if-no-files-found: error
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: build seshat executable
2+
3+
on:
4+
pull_request:
5+
workflow_call:
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-wheels:
10+
name: Build Seshat executable
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: scala
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-java@v4
20+
with:
21+
distribution: 'temurin'
22+
java-version: ${{ matrix.JAVA_VERSION }}
23+
24+
- name: Cache for Scala Dependencies
25+
uses: actions/cache@v4
26+
with:
27+
path: |
28+
~/.mill/download
29+
~/.m2/repository
30+
~/.cache/coursier
31+
key: ${{ runner.os }}-java-mill-${{ matrix.JAVA_VERSION }}-${{ hashFiles('**/build.sc') }}
32+
restore-keys: ${{ runner.os }}-java-mill-
33+
34+
- name: Compile Scala Code
35+
run: |
36+
./mill --no-server clean
37+
./mill --no-server --disable-ticker seshat.compile
38+
39+
- name: Build executable file
40+
run: ./mill --no-server --disable-ticker seshat.executable
41+
42+
- name: Upload wheels
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: seshat
46+
path: ./bin/seshat
47+
if-no-files-found: error
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,29 @@ on:
77

88
jobs:
99
build-wheels:
10-
name: Build wheels for ${{ matrix.python }}
10+
name: Build wheels for ${{ matrix.PYTHON_VERSION }}
1111
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: python
1215
strategy:
1316
matrix:
14-
python: ["3.11", "3.12", "3.13"]
17+
PYTHON_VERSION: ["3.11", "3.12", "3.13"]
1518

1619
steps:
1720
- uses: actions/checkout@v4
18-
with:
19-
submodules: "true"
2021

2122
- name: Set up Python ${{ matrix.PYTHON_VERSION }}
2223
uses: actions/setup-python@v5
2324
with:
24-
python-version: ${{ matrix.python }}
25+
python-version: ${{ matrix.PYTHON_VERSION }}
2526

2627
- name: Build wheels
27-
run: pip wheel --no-deps -w wheelhouse .
28+
run: pip wheel --no-deps -w /tmp/wheelhouse .
2829

2930
- name: Upload wheels
3031
uses: actions/upload-artifact@v4
3132
with:
32-
name: tp53-wheels-${{ matrix.python }}
33-
path: ./wheelhouse/tp53*.whl
33+
name: tp53-wheels-${{ matrix.PYTHON_VERSION }}
34+
path: /tmp/wheelhouse/tp53*.whl
3435
if-no-files-found: error

.github/workflows/publish_tp53.yml

Lines changed: 28 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ env:
1010
jobs:
1111
on-main-branch-check:
1212
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
working-directory: python
1316
outputs:
1417
on_main: ${{ steps.contains_tag.outputs.retval }}
1518
steps:
@@ -23,53 +26,27 @@ jobs:
2326
reference: "main"
2427
tag: "${{ github.ref_name }}"
2528

26-
tests:
27-
name: tests
29+
python-tests:
30+
name: python-tests
2831
needs: on-main-branch-check
2932
if: ${{ needs.on-main-branch-check.outputs.on_main == 'true' }}
30-
uses: "./.github/workflows/tests.yml"
33+
uses: "./.github/workflows/tests_python.yml"
34+
35+
scala-tests:
36+
name: scala-tests
37+
needs: on-main-branch-check
38+
if: ${{ needs.on-main-branch-check.outputs.on_main == 'true' }}
39+
uses: "./.github/workflows/tests_scala.yml"
3140

3241
build-wheels:
3342
name: build wheels
34-
needs: tests
35-
uses: "./.github/workflows/wheels.yml"
43+
needs: python-tests
44+
uses: "./.github/workflows/build_wheels.yml"
3645

3746
build-sdist:
3847
name: build source distribution
39-
needs: tests
40-
runs-on: ubuntu-latest
41-
steps:
42-
- uses: actions/checkout@v4
43-
with:
44-
fetch-depth: 0
45-
submodules: true
46-
47-
- uses: actions/setup-python@v5
48-
with:
49-
python-version: 3.12
50-
51-
- name: Install poetry
52-
run: |
53-
python -m pip install --upgrade pip
54-
python -m pip install poetry==${{env.POETRY_VERSION}}
55-
56-
- name: Configure poetry
57-
shell: bash
58-
run: poetry config virtualenvs.in-project true
59-
60-
- name: Install dependencies
61-
run: poetry install --no-interaction --no-root --without=dev
62-
63-
- name: Install project
64-
run: poetry install --no-interaction --without=dev
65-
66-
- name: Build package
67-
run: poetry build --format=sdist
68-
69-
- uses: actions/upload-artifact@v4
70-
with:
71-
name: tp53-sdist
72-
path: dist/*.tar.gz
48+
needs: python-tests
49+
uses: "./.github/workflows/build_sdist.yml"
7350

7451
publish-to-pypi:
7552
runs-on: ubuntu-latest
@@ -90,6 +67,11 @@ jobs:
9067
skip-existing: true
9168
verbose: true
9269

70+
build-seshat-exe:
71+
name: build seshat executable
72+
needs: scala-tests
73+
uses: "./.github/workflows/buil_seshat_exe.yml"
74+
9375
make-changelog:
9476
runs-on: ubuntu-latest
9577
needs: publish-to-pypi
@@ -117,8 +99,13 @@ jobs:
11799
permissions:
118100
contents: write
119101
pull-requests: read
120-
needs: make-changelog
102+
needs: [build-seshat-exe, make-changelog]
121103
steps:
104+
- uses: actions/download-artifact@v4
105+
with:
106+
pattern: "seshat"
107+
merge-multiple: true
108+
122109
- name: Create Draft Release
123110
id: create_release
124111
uses: softprops/action-gh-release@v2
@@ -127,3 +114,4 @@ jobs:
127114
body: ${{ needs.make-changelog.outputs.release_body }}
128115
draft: false
129116
prerelease: false
117+
files: "seshat"
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: unit tests
1+
name: python tests
22

33
on:
44
push:
@@ -13,7 +13,11 @@ env:
1313

1414
jobs:
1515
Tests:
16+
name: Python tests with ${{ matrix.PYTHON_VERSION }}
1617
runs-on: ubuntu-latest
18+
defaults:
19+
run:
20+
working-directory: python
1721
strategy:
1822
matrix:
1923
PYTHON_VERSION: ["3.11", "3.12", "3.13"]

.github/workflows/tests_scala.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: scala tests
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
tags:
8+
- "!**"
9+
workflow_call:
10+
11+
jobs:
12+
Tests:
13+
name: Scala tests with Java ${{ matrix.JAVA_VERSION }}
14+
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
working-directory: scala
18+
strategy:
19+
matrix:
20+
suite: [ seshat ]
21+
JAVA_VERSION: [ 11, 17, 21 ]
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-java@v4
25+
with:
26+
distribution: 'temurin'
27+
java-version: ${{ matrix.JAVA_VERSION }}
28+
- name: Cache for Scala Dependencies
29+
uses: actions/cache@v4
30+
with:
31+
path: |
32+
~/.mill/download
33+
~/.m2/repository
34+
~/.cache/coursier
35+
key: ${{ runner.os }}-java-mill-${{ matrix.JAVA_VERSION }}-${{ hashFiles('**/build.sc') }}
36+
restore-keys: ${{ runner.os }}-java-mill-
37+
- name: Compile Scala Code
38+
run: |
39+
./mill --no-server clean
40+
./mill --no-server --disable-ticker ${{ matrix.suite }}.compile
41+
- name: Test Scala Code
42+
run: |
43+
./mill --no-server --disable-ticker ${{ matrix.suite }}.test
44+
- name: Create Code Coverage Report
45+
if: matrix.java-version == '11'
46+
run: |
47+
./mill --no-server --disable-ticker ${{ matrix.suite }}.scoverage.htmlReport
48+
- name: Upload Code Coverage Report
49+
uses: actions/upload-artifact@v4
50+
if: matrix.java-version == '11'
51+
with:
52+
name: code-coverage
53+
path: out/seshat/scoverage/htmlReport.dest/

0 commit comments

Comments
 (0)