From 14a44f449e597e1c927c3a27c12ca2c17c50a032 Mon Sep 17 00:00:00 2001 From: Nicolas Berthier Date: Thu, 15 Aug 2024 13:32:11 +0200 Subject: [PATCH] Add Windows CI for Java interoperability branch --- .github/workflows/macos-java.yml | 4 +- .github/workflows/ubuntu-java.yml | 4 +- .github/workflows/windows-java.yml | 106 +++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/windows-java.yml diff --git a/.github/workflows/macos-java.yml b/.github/workflows/macos-java.yml index 49de54bb1..af8df19ca 100644 --- a/.github/workflows/macos-java.yml +++ b/.github/workflows/macos-java.yml @@ -3,8 +3,8 @@ name: MacOS with Java interoperability on: pull_request: branches: [ java-interop ] - push: - branches: [ more-ci-updates ] + # push: + # branches: [ java-interop ] # manual run in actions tab - for all branches workflow_dispatch: diff --git a/.github/workflows/ubuntu-java.yml b/.github/workflows/ubuntu-java.yml index 1fcb1d370..bfdd629d8 100644 --- a/.github/workflows/ubuntu-java.yml +++ b/.github/workflows/ubuntu-java.yml @@ -3,8 +3,8 @@ name: Ubuntu with Java interoperability on: pull_request: branches: [ java-interop ] - push: - branches: [ more-ci-updates ] + # push: + # branches: [ java-interop ] # manual run in actions tab - for all branches workflow_dispatch: diff --git a/.github/workflows/windows-java.yml b/.github/workflows/windows-java.yml new file mode 100644 index 000000000..f6d76fefb --- /dev/null +++ b/.github/workflows/windows-java.yml @@ -0,0 +1,106 @@ +name: Windows MSYS2 with Java interoperability + +on: + pull_request: + branches: [ java-interop ] + push: + branches: [ java-interop-ci4windows ] + # manual run in actions tab - for all branches + workflow_dispatch: + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: + - windows-latest + + runs-on: ${{ matrix.os }} + + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install packages + uses: msys2/setup-msys2@v2 + with: + update: true + install: autoconf automake libtool make mingw-w64-x86_64-ncurses mingw-w64-x86_64-libxml2 mingw-w64-x86_64-cjson mingw-w64-x86_64-db mingw-w64-x86_64-gmp libdb-devel mingw-w64-x86_64-gcc flex bison gmp-devel help2man texinfo gettext-devel + + - name: Set git user + run: | + git config --global user.name github-actions + git config --global user.email github-actions-bot@users.noreply.github.com + + - name: bootstrap + run: | + ./autogen.sh + autoconf + autoreconf --install --force + shell: msys2 {0} + + - name: Build environment setup + run: | + mkdir _build + echo "JAVA_HOME=$JAVA_HOME" + echo "export PATH=\"$(cygpath -u "$JAVA_HOME")/bin:\$PATH\"" >> ~/.bash_profile + shell: msys2 {0} + + - name: configure + run: | + cd _build + echo "$PATH" + java_home="$(cygpath -u "$JAVA_HOME")" + # thanks @revelator & @GitMensch ;-) + # (cf https://github.com/msys2/MINGW-packages/discussions/8056) + lt_cv_deplibs_check_method=pass_all \ + ../configure --enable-cobc-internal-checks \ + --enable-hardening \ + --prefix /opt/cobol/gnucobol \ + --exec-prefix /opt/cobol/gnucobol \ + --with-java \ + JAVA_HOME="$java_home" \ + JAVA="$java_home/bin/java" \ + JAVAC="$java_home/bin/javac" + shell: msys2 {0} + + - name: Upload config.log + uses: actions/upload-artifact@v4 + # if: failure() + with: + name: config-${{ matrix.os }}.log + path: _build/config.log + + - name: make + run: | + make -C _build --jobs=$(($(nproc)+1)) + shell: msys2 {0} + + - name: check + continue-on-error: true + run: | + sed '/AT_SETUP(\[ACCEPT OMITTED (SCREEN)\])/a \ + AT_SKIP_IF(\[true\])' \ + -i tests/testsuite.src/run_accept.at + make -C _build check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" + shell: msys2 {0} + + - name: Upload testsuite.log + uses: actions/upload-artifact@v4 + with: + name: testsuite-${{ matrix.os }}.log + path: _build/tests/testsuite.log + + - name: install + run: | + make -C _build install + find /opt/cobol > _build/install.log + shell: msys2 {0} + + - name: Upload install.log + uses: actions/upload-artifact@v4 + with: + name: install-${{ matrix.os }}.log + path: _build/install.log