1
- name : Create Release on Tag Push
1
+ name : Export XML and Release on Tag Push
2
2
3
3
on :
4
4
push :
8
8
jobs :
9
9
build :
10
10
runs-on : ubuntu-latest
11
+
12
+ env :
13
+ # ** FOR GENERAL USE, LIKELY NEED TO CHANGE: **
14
+ package : TestCoverage
15
+ container_image : intersystemsdc/iris-community:latest
16
+
17
+ # ** FOR GENERAL USE, MAY NEED TO CHANGE: **
18
+ build_flags : -dev -verbose # Load in -dev mode to get unit test code preloaded
19
+ test_package : UnitTest
20
+
21
+ # ** FOR GENERAL USE, SHOULD NOT NEED TO CHANGE: **
22
+ instance : iris
23
+ # Note: test_reports value is duplicated in test_flags environment variable
24
+ test_reports : test-reports
25
+ test_flags : >-
26
+ -verbose -DUnitTest.ManagerClass=TestCoverage.Manager -DUnitTest.JUnitOutput=/test-reports/junit.xml
27
+ -DUnitTest.FailuresAreFatal=1 -DUnitTest.Manager=TestCoverage.Manager
28
+ -DUnitTest.UserParam.CoverageReportClass=TestCoverage.Report.Cobertura.ReportGenerator
29
+ -DUnitTest.UserParam.CoverageReportFile=/source/coverage.xml
30
+
11
31
steps :
12
32
- name : Checkout code
13
- uses : actions/checkout@v2
33
+ uses : actions/checkout@v4
34
+
35
+ - name : Run Container
36
+ run : |
37
+ # Create test_reports directory to share test results before running container
38
+ mkdir $test_reports
39
+ chmod 777 $test_reports
40
+ # Run InterSystems IRIS instance
41
+ docker pull $container_image
42
+ docker run -d -h $instance --name $instance -v $GITHUB_WORKSPACE:/source -v $GITHUB_WORKSPACE/$test_reports:/$test_reports --init $container_image
43
+ echo halt > wait
44
+ # Wait for instance to be ready
45
+ until docker exec --interactive $instance iris session $instance < wait; do sleep 1; done
46
+
47
+ - name : Install TestCoverage
48
+ run : |
49
+ echo "zpm \"install testcoverage\":1:1" > install-testcoverage
50
+ docker exec --interactive $instance iris session $instance -B < install-testcoverage
51
+ # Workaround for permissions issues in TestCoverage (creating directory for source export)
52
+ chmod 777 $GITHUB_WORKSPACE
53
+
54
+ - name : Build, Test, and Export XML
55
+ run : |
56
+ # Run build
57
+ echo "zpm \"load /source $build_flags\":1:1" > build
58
+ # Test package is compiled first as a workaround for some dependency issues.
59
+ echo "do \$System.OBJ.CompilePackage(\"$test_package\",\"ckd\") " > test
60
+ # Run tests
61
+ echo "zpm \"$package test -only $test_flags\":1:1" >> test
62
+ # Pick the targets to export as XML
63
+ echo 'set list("TestCoverage.*.cls") = ""' >> export
64
+ echo 'set list("TestCoverage.inc") = ""' >> export
65
+ echo 'do $System.OBJ.Export(.list,"TestCoverage-${{ github.ref }}.xml","/exportversion=2017.2")' >> export
66
+ docker exec --interactive $instance iris session $instance -B < build && docker exec --interactive $instance iris session $instance -B < test && docker exec --interactive $instance iris session $instance -B < export
67
+
14
68
- name : Create Release
15
69
id : create_release
16
- uses : actions/create -release@v1
70
+ uses : softprops/action-gh -release@v1
17
71
env :
18
72
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
19
73
with :
74
+ files : TestCoverage-${{ github.ref }}.xml
20
75
tag_name : ${{ github.ref }}
21
- release_name : Release ${{ github.ref }}
76
+ name : Release ${{ github.ref }}
22
77
body : |
23
- Changes in this Release
78
+ Automated release created by [action-gh-release](https://github.com/softprops/action-gh-release).
24
79
draft : false
25
80
prerelease : false
0 commit comments