Skip to content

Commit c4efab4

Browse files
Merge pull request #245 from yutaro-sakamoto/v1.0.16
Release v1.0.16
2 parents f2da033 + f796179 commit c4efab4

File tree

112 files changed

+1303
-567
lines changed

Some content is hidden

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

112 files changed

+1303
-567
lines changed

.github/workflows/cicd.yml

Lines changed: 47 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ on:
66
types: [opened, reopened, review_requested, synchronize]
77

88
env:
9-
CLASSPATH: ":/usr/lib/opensourcecobol4j/libcobj.jar:/usr/lib/opensourcecobol4j/sqlite.jar"
9+
CLASSPATH: ":/usr/lib/opensourcecobol4j/libcobj.jar"
1010

1111
jobs:
12-
run-tests:
12+
build:
1313
strategy:
1414
matrix:
1515
os: ["ubuntu:22.04", "almalinux:9"]
@@ -28,70 +28,57 @@ jobs:
2828
if: matrix.os == 'almalinux:9'
2929
run: |
3030
dnf -y update
31-
dnf install -y java-17-openjdk-devel gcc gcc-c++ make bison flex automake autoconf diffutils gettext
31+
dnf install -y java-17-openjdk-devel gcc make bison flex automake autoconf diffutils gettext
3232
3333
- name: Checkout opensource COBOL 4J
3434
uses: actions/checkout@v3
3535

3636
- name: Install opensource COBOL 4J
3737
run: |
38-
curl -L -k -o libcobj/sqlite-jdbc/sqlite.jar https://github.com/xerial/sqlite-jdbc/releases/download/3.36.0.3/sqlite-jdbc-3.36.0.3.jar
3938
./configure --prefix=/usr/
4039
make
41-
make install
40+
echo ARTIFACT_NAME=${{ matrix.os }} | sed 's/:/-/g' >> $GITHUB_ENV
4241
43-
- name: Run tests "command-line-options"
42+
- name: Create an artifact file
4443
run: |
45-
cd tests/
46-
./command-line-options
47-
48-
- name: Run tests "misc"
49-
run: |
50-
cd tests/
51-
./misc
52-
53-
- name: Run tests "data-rep"
54-
run: |
55-
cd tests/
56-
./data-rep
57-
58-
- name: Run tests "i18n_sjis"
59-
run: |
60-
cd tests/
61-
./i18n_sjis
62-
63-
- name: Run tests "jp-compat"
64-
run: |
65-
cd tests/
66-
./jp-compat
67-
68-
- name: Run tests "run"
69-
run: |
70-
cd tests/
71-
./run
72-
73-
- name: Run tests "syntax"
74-
run: |
75-
cd tests/
76-
./syntax
77-
78-
- name: Run NIST test
79-
run: |
80-
cd tests/cobol85
81-
make test
44+
cd ../
45+
tar zcf opensourcecobol4j.tar.gz opensourcecobol4j
46+
mv opensourcecobol4j.tar.gz opensourcecobol4j
47+
48+
- name: Upload an artifact
49+
uses: actions/upload-artifact@v3
50+
with:
51+
name: opensourcecobol4j-${{ env.ARTIFACT_NAME }}
52+
path: opensourcecobol4j.tar.gz
8253

83-
- name: Run Extra NIST test
84-
run: |
85-
cd tests/cobol85
86-
make test-extra
54+
run-test-other:
55+
needs: build
56+
strategy:
57+
matrix:
58+
test_name: ["command-line-options", "data-rep", "i18n_sjis", "jp-compat", "run", "syntax"]
59+
uses: ./.github/workflows/test-other.yml
60+
with:
61+
test-name: ${{ matrix.test_name }}
8762

88-
#- name: Run tests "i18n_utf8"
89-
# run: |
90-
# ./configure --prefix=/usr/ --with-vbisam --enable-utf8
91-
# make
92-
# make install
93-
# ./i18n_utf8 || true
94-
# cd ../
63+
run-test-nist:
64+
needs: build
65+
strategy:
66+
matrix:
67+
test_name: ["IC", "IF", "IX", "NC", "OB", "RL", "SG", "SM", "SQ", "ST"]
68+
uses: ./.github/workflows/test-nist.yml
69+
with:
70+
test-name: ${{ matrix.test_name }}
71+
check-result: true
72+
73+
run-test-nist-extra:
74+
needs: build
75+
strategy:
76+
matrix:
77+
test_name: ["CM", "DB", "RW"]
78+
uses: ./.github/workflows/test-nist.yml
79+
with:
80+
test-name: ${{ matrix.test_name }}
81+
check-result: false
9582

9683
static_analysis:
9784
runs-on: ubuntu-latest
@@ -109,33 +96,28 @@ jobs:
10996
run: |
11097
sudo apt-get update -y
11198
sudo apt-get install -y clang-format cppcheck
112-
curl -L -o google-java-format.jar https://github.com/google/google-java-format/releases/download/v1.15.0/google-java-format-1.15.0-all-deps.jar
113-
curl -L -o pmd-bin-6.52.0.zip https://github.com/pmd/pmd/releases/download/pmd_releases%2F6.52.0/pmd-bin-6.52.0.zip
114-
curl -L -o spotbugs-4.7.3.zip https://github.com/spotbugs/spotbugs/releases/download/4.7.3/spotbugs-4.7.3.zip
115-
unzip pmd-bin-6.52.0.zip
116-
unzip spotbugs-4.7.3.zip
11799
118100
- name: Install opensource COBOL 4J
119101
run: |
120102
sudo apt install -y build-essential bison flex gettext texinfo automake autoconf
121-
curl -L -k -o libcobj/sqlite-jdbc/sqlite.jar https://github.com/xerial/sqlite-jdbc/releases/download/3.36.0.3/sqlite-jdbc-3.36.0.3.jar
122103
./configure --prefix=/usr/
123104
make
124105
sudo make install
125106
126107
- name: Check format with google-java-format and clang-format
127108
run: |
128-
export PATH_GOOGLE_JAVA_FORMAT=${PWD}/google-java-format.jar
129109
./check-format
130110
131-
- name: Run SpotBugs
111+
- name: Run SpotBugs (ignore results)
132112
run: |
133-
java -jar spotbugs-4.7.3/lib/spotbugs.jar -textui libcobj/output
113+
cd libcobj
114+
./gradlew spotbugsMain || true
134115
135116
- name: Run PMD
136117
run: |
137-
pmd-bin-6.52.0/bin/run.sh pmd -d ${PWD}/libcobj/src -R ${PWD}/.github/ruleset.xml -f text
118+
cd libcobj
119+
./gradlew pmdMain
138120
139-
- name: Run cppcheck
121+
- name: Run cppcheck (ignore results)
140122
run: |
141123
cd cobj && cppcheck cobj.c cobj.h codegen.c config.c error.c field.c pplex.c ppparse.c ppparse.h reserved.c tree.c tree.h typeck.c

.github/workflows/coverage.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
name: Make a coverate report
22

33
on:
4-
push:
5-
pull_request:
6-
types: [opened, reopened, review_requested, synchronize]
74
workflow_dispatch:
85

96
env:
10-
CLASSPATH: ":/usr/lib/opensourcecobol4j/libcobj.jar:/usr/lib/opensourcecobol4j/sqlite.jar"
7+
CLASSPATH: ":/usr/lib/opensourcecobol4j/libcobj.jar"
118

129
jobs:
1310
run-tests:
@@ -24,7 +21,6 @@ jobs:
2421

2522
- name: Install opensource COBOL 4J
2623
run: |
27-
curl -L -k -o libcobj/sqlite-jdbc/sqlite.jar https://github.com/xerial/sqlite-jdbc/releases/download/3.36.0.3/sqlite-jdbc-3.36.0.3.jar
2824
./configure CFLAGS='-fprofile-arcs -ftest-coverage' --prefix=/usr/
2925
make
3026
sudo make install

.github/workflows/publish-libcobj.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish package to GitHub Packages
2+
on:
3+
workflow_dispatch:
4+
release:
5+
types: [published]
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
packages: write
12+
steps:
13+
- uses: actions/checkout@v4
14+
- run: |
15+
cd ../
16+
mv opensourcecobol4j/* .
17+
mv libcobj/* opensourcecobol4j
18+
- uses: actions/setup-java@v3
19+
with:
20+
java-version: '11'
21+
distribution: 'temurin'
22+
- name: Validate Gradle wrapper
23+
uses: gradle/wrapper-validation-action@v1
24+
- name: Publish package
25+
uses: gradle/gradle-build-action@v2
26+
with:
27+
arguments: publish
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-nist.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: NIST tests
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
test-name:
7+
required: true
8+
type: string
9+
check-result:
10+
required: true
11+
type: boolean
12+
13+
env:
14+
CLASSPATH: ":/usr/lib/opensourcecobol4j/libcobj.jar"
15+
16+
jobs:
17+
test-other:
18+
strategy:
19+
matrix:
20+
os: ["ubuntu:22.04", "almalinux:9"]
21+
runs-on: ubuntu-latest
22+
container:
23+
image: ${{ matrix.os }}
24+
steps:
25+
- name: Get the artifact name
26+
run: echo ARTIFACT_NAME=${{ matrix.os }} | sed 's/:/-/g' >> $GITHUB_ENV
27+
28+
- uses: actions/download-artifact@v3
29+
with:
30+
name: opensourcecobol4j-${{ env.ARTIFACT_NAME }}
31+
32+
- name: Install dependencies on Ubuntu 22.04
33+
if: matrix.os == 'ubuntu:22.04'
34+
run: |
35+
apt update -y
36+
apt install -y default-jdk build-essential
37+
38+
- name: Install dependencies on AlmaLinux 9
39+
if: matrix.os == 'almalinux:9'
40+
run: |
41+
dnf -y update
42+
dnf install -y java-17-openjdk-devel gcc make perl
43+
44+
- name: Install opensource COBOL 4J
45+
run: |
46+
tar zxf opensourcecobol4j.tar.gz
47+
mv opensourcecobol4j/* .
48+
make install
49+
50+
- name: Run tests ${{ inputs.test-name }}
51+
if: ${{ inputs.check-result }}
52+
run: |
53+
cd tests/cobol85/${{ inputs.test-name }}
54+
make test
55+
test "$(cat report.txt | tail -n 3 | head -n 1 | awk '{print $4}')" = '(100.00%)'
56+
57+
- name: Run tests ${{ inputs.test-name }} (No check result)
58+
if: ${{ inputs.check-result == 'false' }}
59+
run: |
60+
cd tests/cobol85/${{ inputs.test-name }}
61+
make test

.github/workflows/test-other.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Other tests
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
test-name:
7+
required: true
8+
type: string
9+
10+
env:
11+
CLASSPATH: ":/usr/lib/opensourcecobol4j/libcobj.jar"
12+
13+
jobs:
14+
test-other:
15+
strategy:
16+
matrix:
17+
os: ["ubuntu:22.04", "almalinux:9"]
18+
runs-on: ubuntu-latest
19+
container:
20+
image: ${{ matrix.os }}
21+
steps:
22+
- name: Get the artifact name
23+
run: echo ARTIFACT_NAME=${{ matrix.os }} | sed 's/:/-/g' >> $GITHUB_ENV
24+
25+
- uses: actions/download-artifact@v3
26+
with:
27+
name: opensourcecobol4j-${{ env.ARTIFACT_NAME }}
28+
29+
- name: Install dependencies on Ubuntu 22.04
30+
if: matrix.os == 'ubuntu:22.04'
31+
run: |
32+
apt update -y
33+
apt install -y default-jdk build-essential
34+
35+
- name: Install dependencies on AlmaLinux 9
36+
if: matrix.os == 'almalinux:9'
37+
run: |
38+
dnf -y update
39+
dnf install -y java-17-openjdk-devel gcc make diffutils
40+
41+
- name: Install opensource COBOL 4J
42+
run: |
43+
tar zxf opensourcecobol4j.tar.gz
44+
mv opensourcecobol4j/* .
45+
make install
46+
47+
- name: Run tests ${{ inputs.test-name }}
48+
run: |
49+
cd tests/
50+
./${{ inputs.test-name }}

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6+
## [1.0.16] - 2023-10-31
7+
## Added
8+
* Publish libcobj.jar in GitHub Packages
9+
* Implement intrinsic functions
10+
* ORD-MAX (#228)
11+
* ORD-MIN (#228)
12+
* SECONDS-FROM-FORMATTED-TIME (#231)
13+
* SIGN (#231)
14+
* STORED-CHAR-LENGTH (#231)
15+
* TRIM (#244)
16+
## Fixed
17+
* Fix `DECIMAL POINT IS COMMA` in `SPECIAL NAMES` clause. (#233)
618
## [1.0.15] - 2023-09-29
719
### Added
820
- Add new intrinsic functions

CONTRIBUTING.md

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,18 @@ The below sections describe how to setup and run static code analysis.
1414

1515
## Setup static analysis tools
1616

17-
### clang-format
18-
1917
Run `sudo apt install clang-format` in Ubuntu to install `clang-format`.
2018

21-
### google-java-format
22-
23-
Run the following command to download `google-java-format`:
24-
```sh
25-
curl -L -o google-java-format.jar https://github.com/google/google-java-format/releases/download/v1.15.0/google-java-format-1.15.0-all-deps.jar
26-
```
27-
Then set the environment variable `PATH_GOOGLE_JAVA_FORMAT` to the file path of the jar file.
28-
29-
### PMD
30-
31-
Run the following commands to install `PMD`:
32-
```sh
33-
curl -L -o pmd-bin-6.52.0.zip https://github.com/pmd/pmd/releases/download/pmd_releases%2F6.52.0/pmd-bin-6.52.0.zip
34-
unzip pmd-bin-6.52.0.zip
35-
mv pmd-bin-6.52 /usr/local/bin/
36-
rm pmd-bin-6.52.0.zip
37-
```
38-
3919
## Run static analysis
4020

41-
### clang-format and google-java-format
21+
### check with clang-format and google-java-format
4222

4323
Run `./format` in the top directory of opensource COBOL 4J.
4424
If you want to make sure all files are formatted, run `./check-format` in the top directory of opensource COBOL 4J.
4525

4626
### PMD
4727

48-
Run the following command in the top directory of opensource COBOL 4J:
28+
Run the following command in libcobj/ directory:
4929
```
50-
/usr/local/bin/pmd-bin-6.52.0/bin/run.sh -d libcobj/src -R .github/ruleset.xml -f text
30+
./gradlew pmdMain
5131
```

0 commit comments

Comments
 (0)