From a72eb1027dead1457aa45498c77456c5d287e17e Mon Sep 17 00:00:00 2001 From: yutaro-sakamoto <80912876+yutaro-sakamoto@users.noreply.github.com> Date: Tue, 29 Oct 2024 18:37:40 +0900 Subject: [PATCH] Add submodule (#104) * chore: add opensourcecobol4j directory as a git sub module * chore: update workflow files * chore: use opensource COBOL 4J 1.1.2 * fix: checkout processes in workflow files * fix: coverage.yml * fix: ci.yml to pass secrets to test.yml explicitly --- .github/workflows/coverage.yml | 7 +------ .github/workflows/test.yml | 14 +++++--------- .github/workflows/windows-build.yml | 8 ++------ .gitmodules | 3 +++ ocesql/ppout.c | 9 ++++----- opensourcecobol4j | 1 + 6 files changed, 16 insertions(+), 26 deletions(-) create mode 100644 .gitmodules create mode 160000 opensourcecobol4j diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 647f141..6dd5fde 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -58,13 +58,8 @@ jobs: # Checkout - name: Checkout Open-COBOL-ESQL-4j uses: actions/checkout@v4 - - # Checkout opensource COBOL 4J - - name: Checkout opensourcecobol 4J - uses: actions/checkout@v4 with: - repository: opensourcecobol/opensourcecobol4j - path: opensourcecobol4j + submodules: recursive # Install opensource COBOL 4J - name: Install opensource COBOL 4J diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e8db4d4..e05de81 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,19 +57,20 @@ jobs: --health-retries 5 steps: + # Install dependencies (Ubuntu 24.04) - name: Install dependencies on Ubuntu 24.04 if: matrix.os == 'ubuntu:24.04' run: | apt update -y - apt install -y build-essential bison flex gettext texinfo automake autoconf curl + apt install -y build-essential bison flex gettext texinfo automake autoconf curl git # Install dependencies (Almalinux 9) - name: Install dependencies on AlmaLinux 9 if: matrix.os == 'almalinux:9' run: | dnf -y update - dnf install -y gcc make bison flex automake autoconf diffutils gettext + dnf install -y gcc make bison flex automake autoconf diffutils gettext git # Setup JDK - name: Setup JDK @@ -87,14 +88,9 @@ jobs: # Checkout - name: Checkout Open-COBOL-ESQL-4j uses: actions/checkout@v4 - - # Checkout opensource COBOL 4J - - name: Checkout opensourcecobol 4J - uses: actions/checkout@v4 with: - repository: opensourcecobol/opensourcecobol4j - path: opensourcecobol4j - + submodules: recursive + # Install opensource COBOL 4J - name: Install opensource COBOL 4J working-directory: opensourcecobol4j diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 605506d..ffc78cf 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -17,6 +17,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + submodules: recursive - name: Add MSBuild to PATH uses: microsoft/setup-msbuild@v2.0.0 @@ -35,12 +37,6 @@ jobs: database: testdb port: 5432 id: postgres - - - name: Checkout opensource COBOL 4J - uses: actions/checkout@v4 - with: - repository: opensourcecobol/opensourcecobol4j - path: opensourcecobol4j - name: Build libcobj.jar working-directory: opensourcecobol4j/libcobj diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..f02ac3c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "opensourcecobol4j"] + path = opensourcecobol4j + url = https://github.com/opensourcecobol/opensourcecobol4j.git diff --git a/ocesql/ppout.c b/ocesql/ppout.c index ee69795..1f4ca15 100644 --- a/ocesql/ppout.c +++ b/ocesql/ppout.c @@ -2002,24 +2002,23 @@ void ppoutput(char *ppin, char *ppout, struct cb_exec_list *head) { len = strlen(outbuff); fwrite(outbuff, len, 1, outfile); - if (strstr(inbuff, "\n") == NULL){ + if (strstr(inbuff, "\n") == NULL) { fputc('\n', outfile); } if (EOFflg == 1) { fputc('\n', outfile); } - if (lineNUM == l->endLine){ + if (lineNUM == l->endLine) { if (strcmp(l->commandName, "WORKING_END")) { ppbuff(l); } - if (l->next != NULL){ + if (l->next != NULL) { l = l->next; } } - } - else { + } else { outbuff = inbuff; len = strlen(outbuff); fwrite(outbuff, len, 1, outfile); diff --git a/opensourcecobol4j b/opensourcecobol4j new file mode 160000 index 0000000..750d459 --- /dev/null +++ b/opensourcecobol4j @@ -0,0 +1 @@ +Subproject commit 750d4593a99554556c9074cbafeb4ca2d7e5f657