Skip to content

Commit 386130d

Browse files
committed
fix: improving unit tests, improving ci workflows
1 parent a785f31 commit 386130d

16 files changed

Lines changed: 91 additions & 67 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
branches: [ "develop" ]
77
jobs:
88
Build:
9+
if: github.repository == 'CollaborativeStateMachines/Cirrina'
10+
name: Build and Test
911
runs-on: ubuntu-latest
1012
permissions:
1113
contents: read
@@ -36,7 +38,6 @@ jobs:
3638
- name: Publish Test Report
3739
uses: mikepenz/action-junit-report@v3
3840
with:
39-
commit: ${{ github.event.workflow_run.head_sha }}
4041
report_paths: 'build/test-results/test/TEST-*.xml'
4142
fail_on_failure: true
4243
require_tests: true

.github/workflows/docker.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
name: Publish Docker image
22
on:
33
release:
4-
types: [ published ]
4+
types: [published]
5+
push:
6+
branches:
7+
- master
8+
- develop
59
jobs:
610
push_to_registry:
11+
if: github.repository == 'CollaborativeStateMachines/Cirrina'
712
name: Push Docker image to Docker Hub
813
runs-on: ubuntu-latest
914
permissions:
@@ -26,6 +31,15 @@ jobs:
2631
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
2732
with:
2833
images: marlonetheredgeuibk/cirrina
34+
tags: |
35+
type=semver,pattern={{version}},enable=${{ github.event_name == 'release' }}
36+
type=raw,value=stable,enable=${{ github.event_name == 'release' }}
37+
38+
type=raw,value=nightly,enable=${{ github.ref == 'refs/heads/master' }}
39+
type=sha,enable=${{ github.ref == 'refs/heads/master' }}
40+
41+
type=raw,value=unstable,enable=${{ github.ref == 'refs/heads/develop' }}
42+
type=sha,enable=${{ github.ref == 'refs/heads/develop' }}
2943
3044
- name: Build and push Docker image
3145
id: push
@@ -35,4 +49,4 @@ jobs:
3549
file: ./Dockerfile.build
3650
push: true
3751
tags: ${{ steps.meta.outputs.tags }}
38-
labels: ${{ steps.meta.outputs.labels }}
52+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/pkl.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish Artifacts
2+
on:
3+
release:
4+
types: [published]
5+
push:
6+
branches:
7+
- develop
8+
- master
9+
jobs:
10+
Publish:
11+
if: github.repository == 'CollaborativeStateMachines/Cirrina'
12+
name: Publish Artifacts to GitHub
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup GraalVM
18+
uses: graalvm/setup-graalvm@v1
19+
with:
20+
java-version: '21'
21+
distribution: 'graalvm'
22+
github-token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Install Protoc
25+
uses: arduino/setup-protoc@v3
26+
27+
- name: Build
28+
run: ./gradlew build
29+
30+
- name: Build distribution ZIP
31+
if: github.event_name == 'release'
32+
run: ./gradlew distZip
33+
34+
- name: Upload unstable/nightly Pkl packages
35+
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'
36+
uses: actions/upload-artifact@v4
37+
with:
38+
path: build/generated/pkl/packages/csm/*
39+
40+
- name: Upload release artifacts to GitHub Release
41+
if: github.event_name == 'release'
42+
uses: softprops/action-gh-release@v2
43+
with:
44+
files: |
45+
build/generated/pkl/packages/csm/*
46+
build/distributions/*.zip
47+
ATTRIBUTIONS.md
48+
LICENSE
49+
token: ${{ secrets.GITHUB_TOKEN }}
50+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ fabric.properties
179179

180180
# End of https://www.toptal.com/developers/gitignore/api/intellij
181181

182+
/bin
183+
182184
# PlantUML
183185
*.puml
184186

.idea/pklSettings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile.pkl

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/test/java/at/ac/uibk/dps/cirrina/runtime/offline/CompleteTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ public void unsubscribe(String source, String subject) {}
117117
var mockPersistentContext = new InMemoryContext(true) {
118118
@Override
119119
public int assign(String name, Object value) throws IOException {
120-
System.out.println("Assigning " + name + " with value " + value);
121-
122120
// Don't expect any variables assigned except for v
123121
assertTrue(name.equals("v"));
124122

src/test/resources/pkl/complete/main.pkl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
amends "package://localhost:10000/csm/csm@3.0.0#/Csml.pkl"
2-
import "package://localhost:10000/csm/csm@3.0.0#/Csml.pkl"
1+
amends "modulepath:/pkl/csm/Csml.pkl"
2+
import "modulepath:/pkl/csm/Csml.pkl"
33

44
import "stateMachineOne.pkl"
55

src/test/resources/pkl/complete/stateMachineOne.pkl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "package://localhost:10000/csm/csm@3.0.0#/Csml.pkl"
1+
import "modulepath:/pkl/csm/Csml.pkl"
22

33
// State Machine One
44
// ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐

0 commit comments

Comments
 (0)