Skip to content

Commit 29df006

Browse files
committed
Merge master into dev/PChatBot
2 parents 8082a59 + 7c313ac commit 29df006

File tree

1,355 files changed

+626558
-54263
lines changed

Some content is hidden

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

1,355 files changed

+626558
-54263
lines changed

.github/workflows/macosci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,10 @@ jobs:
2424
- name: Build
2525
run: dotnet build --configuration Release
2626
- name: Test
27-
run: dotnet test --configuration Release
27+
run: dotnet test --configuration Release --blame-crash --blame-hang --blame-hang-timeout 300s --logger:"console;verbosity=detailed"
28+
- name: Upload Test Results
29+
uses: actions/upload-artifact@v4
30+
if: always() # This ensures it runs even after test failure
31+
with:
32+
name: test-results
33+
path: Tst/UnitTests/TestResults/**/*.xml
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish PObserveCommons to Maven Central
2+
3+
on:
4+
push:
5+
branches: [ "maven-publish-pobserve-commons-**" ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
working-directory: Src/PObserve/PObserveCommons
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: '17'
23+
distribution: 'temurin'
24+
cache: gradle
25+
26+
- name: Setup Gradle
27+
uses: gradle/gradle-build-action@v2
28+
29+
- name: Set release version
30+
if: github.event_name == 'workflow_dispatch'
31+
run: |
32+
# Replace version in build.gradle.kts
33+
sed -i "s/version = \".*\"/version = \"${{ github.event.inputs.releaseVersion }}\"/" build.gradle.kts
34+
35+
- name: Generate Gradle Wrapper Files
36+
run: gradle wrapper
37+
38+
- name: Build with Gradle
39+
run: ./gradlew build
40+
41+
- name: Publish PObserve Commons to Maven Central
42+
env:
43+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USERNAME }}
44+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASSWORD }}
45+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_PRIVATE_KEY }}
46+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }}
47+
run: ./gradlew publishToMavenCentral --info --build-cache
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Publish PObserveJavaUnitTest to Maven Central
2+
3+
on:
4+
push:
5+
branches: [ "maven-publish-pobserve-java-unit-test-**" ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
working-directory: Src/PObserve/PObserveJavaUnitTest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: '17'
23+
distribution: 'temurin'
24+
25+
- name: Cache Maven dependencies
26+
uses: actions/cache@v3
27+
with:
28+
path: ~/.m2
29+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
30+
restore-keys: ${{ runner.os }}-m2
31+
32+
- name: Import GPG key
33+
uses: crazy-max/ghaction-import-gpg@v6
34+
with:
35+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
36+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
37+
38+
- name: Create Maven settings.xml
39+
run: |
40+
mkdir -p ~/.m2
41+
cat > ~/.m2/settings.xml << 'EOF'
42+
<?xml version="1.0" encoding="UTF-8"?>
43+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
44+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
45+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
46+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
47+
<servers>
48+
<server>
49+
<id>central</id>
50+
<username>${{ secrets.MAVEN_USERNAME }}</username>
51+
<password>${{ secrets.MAVEN_PASSWORD }}</password>
52+
</server>
53+
<server>
54+
<id>gpg.passphrase</id>
55+
<passphrase>${{ secrets.GPG_PASSPHRASE }}</passphrase>
56+
</server>
57+
</servers>
58+
</settings>
59+
EOF
60+
61+
- name: Publish PObserveJavaUnitTest to Maven Central
62+
run:
63+
mvn clean deploy -P release
64+
env:
65+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish PObserveRegressionTesting to Maven Central
2+
3+
on:
4+
push:
5+
branches: [ "maven-publish-pobserve-regression-testing-**" ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
working-directory: Src/PObserve/PObserveRegressionTesting
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: '17'
23+
distribution: 'temurin'
24+
cache: gradle
25+
26+
- name: Setup Gradle
27+
uses: gradle/gradle-build-action@v2
28+
29+
- name: Generate Gradle Wrapper Files
30+
run: gradle wrapper
31+
32+
- name: Build with Gradle
33+
run: ./gradlew build
34+
35+
- name: Publish PObserve Regression Testing to Maven Central
36+
env:
37+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USERNAME }}
38+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASSWORD }}
39+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_PRIVATE_KEY }}
40+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }}
41+
run: ./gradlew publishToMavenCentral --info --build-cache
Lines changed: 102 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,109 @@
1-
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
2-
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
3-
4-
name: Maven Publish
1+
name: Publish to Maven Central
52

63
on:
7-
push:
8-
branches: [ "maven-publish-**" ]
4+
release:
5+
types: [published]
96
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Version to publish (e.g., 0.4.1). Leave empty to use current P version from pom.xml'
10+
required: false
11+
type: string
1012

1113
jobs:
12-
Maven-Publish-Ubuntu:
14+
publish:
1315
runs-on: ubuntu-latest
16+
1417
steps:
15-
- uses: actions/checkout@v3
16-
- name: Set up Java for publishing to Maven Central Repository
17-
uses: actions/setup-java@v3
18-
with:
19-
distribution: 'temurin'
20-
java-version: '11'
21-
server-id: ossrh
22-
server-username: MAVEN_USERNAME
23-
server-password: MAVEN_PASSWORD
24-
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
25-
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
26-
- name: Publish to the Maven Central Repository
27-
working-directory: Src/PRuntimes/PSymRuntime
28-
run: mvn --batch-mode deploy -P release -Dmaven.test.skip
29-
env:
30-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
31-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
32-
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
33-
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up JDK 17
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: '17'
25+
distribution: 'temurin'
26+
27+
- name: Cache Maven dependencies
28+
uses: actions/cache@v3
29+
with:
30+
path: ~/.m2
31+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
32+
restore-keys: ${{ runner.os }}-m2
33+
34+
- name: Import GPG key
35+
uses: crazy-max/ghaction-import-gpg@v6
36+
with:
37+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
38+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
39+
40+
- name: Extract version from release
41+
id: get_version
42+
run: |
43+
if [ "${{ github.event_name }}" = "release" ]; then
44+
VERSION=${{ github.event.release.tag_name }}
45+
# Remove 'v' prefix if present
46+
VERSION=${VERSION#v}
47+
else
48+
VERSION=${{ github.event.inputs.version }}
49+
fi
50+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
51+
echo "Publishing version: $VERSION"
52+
53+
- name: Update PEx version
54+
run: |
55+
cd Src/PEx
56+
# Update the revision property in pom.xml
57+
sed -i "s/<revision>.*<\/revision>/<revision>${{ steps.get_version.outputs.VERSION }}<\/revision>/" pom.xml
58+
echo "Updated PEx version to ${{ steps.get_version.outputs.VERSION }}"
59+
60+
- name: Create Maven settings.xml
61+
run: |
62+
mkdir -p ~/.m2
63+
cat > ~/.m2/settings.xml << 'EOF'
64+
<?xml version="1.0" encoding="UTF-8"?>
65+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
66+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
67+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
68+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
69+
<servers>
70+
<server>
71+
<id>central</id>
72+
<username>${{ secrets.MAVEN_USERNAME }}</username>
73+
<password>${{ secrets.MAVEN_PASSWORD }}</password>
74+
</server>
75+
<server>
76+
<id>gpg.passphrase</id>
77+
<passphrase>${{ secrets.GPG_PASSPHRASE }}</passphrase>
78+
</server>
79+
</servers>
80+
</settings>
81+
EOF
82+
83+
- name: Publish to Maven Central
84+
run: |
85+
cd Src/PEx
86+
mvn clean deploy -P release -DskipTests
87+
env:
88+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
89+
90+
- name: Create deployment summary
91+
run: |
92+
echo "## 🚀 Maven Central Deployment" >> $GITHUB_STEP_SUMMARY
93+
echo "Successfully published **PEx ${{ steps.get_version.outputs.VERSION }}** to Maven Central!" >> $GITHUB_STEP_SUMMARY
94+
echo "" >> $GITHUB_STEP_SUMMARY
95+
echo "### 📦 Artifact Details" >> $GITHUB_STEP_SUMMARY
96+
echo "- **Group ID:** io.github.p-org" >> $GITHUB_STEP_SUMMARY
97+
echo "- **Artifact ID:** pex" >> $GITHUB_STEP_SUMMARY
98+
echo "- **Version:** ${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY
99+
echo "" >> $GITHUB_STEP_SUMMARY
100+
echo "### 📋 Maven Dependency" >> $GITHUB_STEP_SUMMARY
101+
echo '```xml' >> $GITHUB_STEP_SUMMARY
102+
echo '<dependency>' >> $GITHUB_STEP_SUMMARY
103+
echo ' <groupId>io.github.p-org</groupId>' >> $GITHUB_STEP_SUMMARY
104+
echo ' <artifactId>pex</artifactId>' >> $GITHUB_STEP_SUMMARY
105+
echo " <version>${{ steps.get_version.outputs.VERSION }}</version>" >> $GITHUB_STEP_SUMMARY
106+
echo '</dependency>' >> $GITHUB_STEP_SUMMARY
107+
echo '```' >> $GITHUB_STEP_SUMMARY
108+
echo "" >> $GITHUB_STEP_SUMMARY
109+
echo "🔗 [View on Maven Central](https://central.sonatype.com/artifact/io.github.p-org/pex/${{ steps.get_version.outputs.VERSION }})" >> $GITHUB_STEP_SUMMARY

.github/workflows/pex.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# This workflow will use the published PEx Maven package instead of building it locally
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: PEx on Ubuntu
5+
6+
on:
7+
push:
8+
pull_request:
9+
workflow_dispatch:
10+
inputs:
11+
args:
12+
description: Additional arguments
13+
default: ""
14+
required: false
15+
pex_version:
16+
description: PEx version to use (defaults to latest published version)
17+
required: false
18+
type: string
19+
jobs:
20+
PEx-Setup-And-Test-Ubuntu:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v1
24+
- name: Setup .NET Core
25+
uses: actions/setup-dotnet@v1
26+
with:
27+
dotnet-version: 8.0.x
28+
- name: Set up JDK
29+
uses: actions/setup-java@v1
30+
with:
31+
java-version: 17
32+
- name: Cache Maven packages
33+
uses: actions/cache@v4
34+
with:
35+
path: ~/.m2
36+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
37+
restore-keys: ${{ runner.os }}-m2
38+
- name: Determine PEx version
39+
id: pex_version
40+
run: |
41+
# Use the version provided in the workflow input, or default to the latest version in pom.xml
42+
if [ -n "${{ github.event.inputs.pex_version }}" ]; then
43+
PEX_VERSION="${{ github.event.inputs.pex_version }}"
44+
else
45+
# Extract the version from the PEx pom.xml
46+
PEX_VERSION=$(grep -oP '<revision>\K[^<]+' Src/PEx/pom.xml)
47+
fi
48+
echo "PEX_VERSION=${PEX_VERSION}" >> $GITHUB_ENV
49+
echo "Using PEx version: ${PEX_VERSION}"
50+
- name: Add PEx Maven dependency
51+
run: |
52+
echo "Using published PEx Maven package (io.github.p-org:pex:${PEX_VERSION}) instead of building locally"
53+
# The P compiler will automatically use the published package from Maven Central
54+
- name: Install P as a tool
55+
run: dotnet tool install --global p
56+
- name: Test with published PEx package
57+
run: |
58+
# Navigate to the ClientServer tutorial
59+
cd Tutorial/1_ClientServer
60+
61+
# Compile the P program
62+
echo "Compiling ClientServer tutorial with published PEx package..."
63+
p compile --mode pex
64+
65+
# Check if compilation was successful
66+
if [ $? -ne 0 ]; then
67+
echo "Error: Failed to compile ClientServer tutorial"
68+
exit 1
69+
fi
70+
71+
# Run a test case
72+
echo "Running test case with published PEx package..."
73+
p check --mode pex -tc tcSingleClient -t 60 --checker-args :--max-choices-per-schedule:1000000:--max-choices-per-call:100 || true
74+
75+
# We consider the test successful regardless of the exit code
76+
# because we're just testing that the PEx package can be used
77+
78+
echo "Successfully tested published PEx package (io.github.p-org:pex:${PEX_VERSION})"

0 commit comments

Comments
 (0)