Skip to content

Commit 72b2c16

Browse files
committed
Switch from Azure Pipeline to Github Actions.
Minimize infrastructure dependencies.
1 parent 2de2073 commit 72b2c16

File tree

4 files changed

+73
-33
lines changed

4 files changed

+73
-33
lines changed

.github/workflows/main.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up JDK 1.8
13+
uses: actions/setup-java@v1
14+
with:
15+
java-version: 1.8
16+
- name: Get current date
17+
id: date
18+
run: echo "::set-output name=date::$(date +'%Y%m%d%H%M')"
19+
- name: Build with Ant
20+
run: ant -noinput -buildfile build.xml -Dtimestamp=${{steps.date.outputs.date}}
21+
- name: Create Release
22+
id: create_release
23+
uses: actions/create-release@v1
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
tag_name: ${{steps.date.outputs.date}}
28+
release_name: ${{steps.date.outputs.date}}
29+
draft: false
30+
prerelease: false
31+
- name: Upload Release Asset
32+
id: upload-release-asset
33+
uses: actions/upload-release-asset@v1.0.1
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
with:
37+
upload_url: ${{ steps.create_release.outputs.upload_url }}
38+
asset_path: dist/CommunityModules-${{steps.date.outputs.date}}.jar
39+
asset_name: CommunityModules-${{steps.date.outputs.date}}.jar
40+
asset_content_type: application/zip

azure-pipelines.yml

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

build.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
<property name="lib" location="lib"/>
77
<property name="tests" location="tests"/>
88

9+
<tstamp>
10+
<format property="timestamp"
11+
pattern="yyyyMMdHHmm"
12+
locale="en,UK"/>
13+
</tstamp>
14+
915
<target name="init" description="Create the build and dist directory structure">
1016
<mkdir dir="${build}"/>
1117
<mkdir dir="${dist}"/>
@@ -25,7 +31,7 @@
2531

2632
<target name="dist" depends="compile" description="Combine the module overwrites and the TLA+ definitions into a distribution">
2733
<tstamp/>
28-
<jar jarfile="${dist}/CommunityModules-${DSTAMP}${TSTAMP}.jar">
34+
<jar jarfile="${dist}/CommunityModules-${timestamp}.jar">
2935
<fileset dir="${build}/"
3036
includes="**/*.class"/>
3137
<fileset dir="${src}/"
@@ -50,7 +56,7 @@
5056
<classpath>
5157
<pathelement location="${lib}/tla2tools.jar" />
5258
<!-- The jar that has just been built by the dist target. -->
53-
<pathelement location="${dist}/CommunityModules-${DSTAMP}${TSTAMP}.jar" />
59+
<pathelement location="${dist}/CommunityModules-${timestamp}.jar" />
5460
</classpath>
5561
</java>
5662
</target>

modules/IOUtils.tla

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,28 @@ IOSerialize(val, absoluteFilename, compress) == TRUE
1010
IODeserialize(absoluteFilename, compressed) == CHOOSE val : TRUE
1111

1212
============================================================================
13+
14+
\* Writes a TLA+ expression to the given file.
15+
\* TODO: Decide if it should write a module preamble.
16+
\* Write is easier to implement than Read because it goes from (valid) TLA+
17+
\* and writes a file whereas Read has to parse it.
18+
IOWrite(exp, absoluteFilename) == TRUE
19+
20+
\* Reads a TLA+ expression from a file.
21+
\* TODO: Decide if it reads just a string from a file or expects (valid) TLA+.
22+
\* For trace validation it would be preferable to read strings.
23+
\* Constant-level expression (what's a use-case to read fileS during state space exploration?
24+
IORead(absoluteFilename) == TRUE
25+
26+
TLAParse(IORead("C:\\foo\bar"))
27+
28+
(* condition generally of level up to action (but not temporal), e.g. Inv'. *)
29+
30+
\* Run the given OS command if condition evaluates to true.
31+
\* This is novel and cannot be done otherwise.
32+
\* TODO: What to pass to os command? osCommand a string that a user munges directly
33+
\* in/with TLA+.
34+
\* Can IOWrite/IORead be spec'ed with IOExec?
35+
IOExec(condition, osCommand) == TRUE
36+
37+
=============================================================================

0 commit comments

Comments
 (0)