[newlib-cygwin/main] Cygwin: CI: Pass the just-built cygwin to a subsequent job

Jon Turney via Cygwin-cvs <[email protected]>
Newsgroups gmane.os.cygwin.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=d29fb91fc10b9c5845aa7f96146cedb8d44921db

commit d29fb91fc10b9c5845aa7f96146cedb8d44921db
Author: Jon Turney <[email protected]>
Date:   Mon Mar 24 19:53:36 2025 +0000

    Cygwin: CI: Pass the just-built cygwin to a subsequent job

Diff:
---
 .github/workflows/cygwin.yml | 67 ++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 62 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml
index b5b1e163e..7701e8aba 100644
--- a/.github/workflows/cygwin.yml
+++ b/.github/workflows/cygwin.yml
@@ -148,16 +148,34 @@ jobs:
     - name: Build Cygwin
       run: >-
         export PATH=/usr/bin:$(cygpath ${SYSTEMROOT})/system32 &&
+        export DESTDIR=$(realpath $(pwd)/install) &&
         mkdir build install &&
         (cd winsup; ./autogen.sh) &&
         cd build &&
-        ../configure --prefix=$(realpath $(pwd)/../install) -v &&
+        ../configure --prefix=/usr -v &&
         export MAKEFLAGS=-j$(nproc) &&
         make &&
-        make install &&
+        make install tooldir=/usr gcc_tooldir=/usr DESTDIR=${DESTDIR} &&
         (cd */newlib; make info man) &&
-        (cd */newlib; make install-info install-man)
-      shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
+        (cd */newlib; make install-info install-man tooldir=/usr gcc_tooldir=/usr DESTDIR=${DESTDIR})
+      shell: bash --noprofile --norc -eo pipefail '{0}'
+
+    # adjust install so it matches the physical arrangement of directories when
+    # unpacked by setup
+    - name: Rearrange for default mountpoints
+      run: |
+        mv -v install/usr/bin install/bin
+        mv -v install/usr/lib install/lib
+      shell: bash --noprofile --norc -o igncr -eo pipefail '{0}'
+
+    # upload installed cygwin as an artifact, for subsequent use in
+    # test job(s)
+    - name: Make Cygwin installation artifact
+      uses: actions/upload-artifact@v4
+      with:
+        name: cygwin-install-${{ matrix.pkgarch }}
+        path: |
+          install
 
     # test
     - name: Test Cygwin
@@ -167,7 +185,7 @@ jobs:
         cd build &&
         (export PATH=${{ matrix.target }}/winsup/testsuite/testinst/bin:${PATH} && cmd /c $(cygpath -wa ${{ matrix.target }}/winsup/cygserver/cygserver) &) &&
         (cd ${{ matrix.target }}/winsup; make check AM_COLOR_TESTS=always)
-      shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
+      shell: bash --noprofile --norc -eo pipefail '{0}'
 
     # upload test logs to facilitate investigation of problems
     - name: Upload test logs
@@ -182,3 +200,42 @@ jobs:
     # workaround problems with actions/checkout post-run step using cygwin git
     - name: Avoid actions/checkout post-run step using Cygwin git
       run: bash -c 'rm /usr/bin/git.exe'
+
+  windows-test:
+    needs: windows-build
+
+    runs-on: windows-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+        - target: x86_64-pc-cygwin
+          pkgarch: x86_64
+    name: Windows tests ${{ matrix.pkgarch }}
+
+    steps:
+    # install cygwin
+    - name: Install Cygwin
+      uses: cygwin/cygwin-install-action@master
+      with:
+        platform: ${{ matrix.pkgarch }}
+
+    # fetch the just-built cygwin installation artifact
+    - name: Unpack just-built Cygwin artifact
+      uses: actions/download-artifact@v4
+      with:
+        name: cygwin-install-${{ matrix.pkgarch }}
+        # the path specified here should match the install-dir of
+        # cygwin-install-action above, so we unpack the artifact over it
+        path: 'D:\cygwin'
+
+    # This isn't quite right, as it just overwrites existing files, it doesn't
+    # remove anything which is no longer provided. Ideally, we'd make a cygwin
+    # package of the just-built cygwin version and install it here, but tools
+    # don't exist (yet) to let us do that...
+
+    # run tests
+    - name: Run tests
+      run: |
+        uname -a
+      shell: bash --noprofile --norc -o igncr -eo pipefail '{0}'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.