]> granicus.if.org Git - libevent/commitdiff
ci: split build and test into separate jobs
authorAzat Khuzhin <azat@libevent.org>
Tue, 10 Aug 2021 19:04:43 +0000 (22:04 +0300)
committerAzat Khuzhin <azat@libevent.org>
Sun, 19 Sep 2021 06:21:43 +0000 (09:21 +0300)
.github/workflows/coverage.yml
.github/workflows/linux.yml
.github/workflows/macos.yml
.github/workflows/mingw.yml
.github/workflows/windows.yml

index b65e1142673b85dea6be7c8c4de21cda7b07aa1d..67707bbd578b04b95364f8737ee5d3b77e9971de 100644 (file)
@@ -27,16 +27,21 @@ jobs:
       - name: Install Depends
         run: sudo apt install zlib1g-dev libssl-dev build-essential lcov libmbedtls-dev
 
-      - name: Build And Test
+      - name: Build
         shell: bash
         run: |
             export JOBS=20
-            export CTEST_PARALLEL_LEVEL=$JOBS
-            export CTEST_OUTPUT_ON_FAILURE=1
             mkdir -p build
             cd build
             cmake .. -DEVENT__COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug
             make -j $JOBS
+
+      - name: Test
+        shell: bash
+        run: |
+            export CTEST_PARALLEL_LEVEL=$JOBS
+            export CTEST_OUTPUT_ON_FAILURE=1
+            cd build
             make verify_coverage
 
       - name: Coveralls GitHub Action
index db4a3036bcc77db386713e7f882ee5788b669f5b..e6324412403052ce6f3cc3c58ac201b8013983ba 100644 (file)
@@ -59,7 +59,7 @@ jobs:
           sudo apt-get update
           sudo apt-get install -y libmbedtls-dev
 
-      - name: Build And Test
+      - name: Build
         shell: bash
         run: |
           if [ "${{ matrix.EVENT_MATRIX }}" == "DIST" ]; then
@@ -74,9 +74,6 @@ jobs:
             cd $(basename $archive .tar.gz)
           fi
 
-          export TSAN_OPTIONS=suppressions=$PWD/extra/tsan.supp
-          export LSAN_OPTIONS=suppressions=$PWD/extra/lsan.supp
-
           if [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_OPENSSL" ]; then
             EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_OPENSSL=ON"
           elif [ "${{ matrix.EVENT_MATRIX }}" == "NO_SSL" ]; then
@@ -104,15 +101,29 @@ jobs:
             EVENT_CMAKE_OPTIONS=""
           fi
 
-          #run build and test
-          JOBS=20
-          export CTEST_PARALLEL_LEVEL=$JOBS
-          export CTEST_OUTPUT_ON_FAILURE=1
           mkdir -p build
           cd build
           echo [cmake]: cmake .. $EVENT_CMAKE_OPTIONS
           cmake .. $EVENT_CMAKE_OPTIONS || (rm -rf * && cmake .. $EVENT_CMAKE_OPTIONS)
           cmake --build .
+
+      - name: Test
+        shell: bash
+        run: |
+          JOBS=20
+          export CTEST_PARALLEL_LEVEL=$JOBS
+          export CTEST_OUTPUT_ON_FAILURE=1
+
+          export TSAN_OPTIONS=suppressions=$PWD/extra/tsan.supp
+          export LSAN_OPTIONS=suppressions=$PWD/extra/lsan.supp
+
+          if [ "${{ matrix.EVENT_MATRIX }}" == "DIST" ]; then
+            cd dist
+            archive=$(echo *.tar.gz)
+            cd $(basename $archive .tar.gz)
+          fi
+          cd build
+
           if [ "${{ matrix.EVENT_MATRIX }}" == "TEST_EXPORT_STATIC" ]; then
             sudo python3 ../test-export/test-export.py static
           elif [ "${{ matrix.EVENT_MATRIX }}" == "TEST_EXPORT_SHARED" ]; then
@@ -167,7 +178,7 @@ jobs:
           sudo apt-get update
           sudo apt-get install -y libmbedtls-dev
 
-      - name: Build And Test
+      - name: Build
         shell: bash
         run: |
           if [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_OPENSSL" ]; then
@@ -193,8 +204,6 @@ jobs:
             EVENT_CONFIGURE_OPTIONS=""
           fi
 
-          #run build and test
-          JOBS=20
           ./autogen.sh
 
           if [ "${{ matrix.EVENT_MATRIX }}" == "DIST" ]; then
@@ -213,6 +222,16 @@ jobs:
           echo [configure]: ../configure $EVENT_CONFIGURE_OPTIONS
           ../configure $EVENT_CONFIGURE_OPTIONS
           make
+      - name: Test
+        shell: bash
+        run: |
+          JOBS=20
+          if [ "${{ matrix.EVENT_MATRIX }}" == "DIST" ]; then
+            cd dist
+            archive=$(echo *.tar.gz)
+            cd $(basename $archive .tar.gz)
+          fi
+          cd build
           make -j $JOBS verify
 
       - uses: actions/upload-artifact@v1
index e13764459470c007479e4d5a52a642cff51cbe36..4f19e59b41e6bfc177ab1ff962c08eb72842f3bd 100644 (file)
@@ -50,7 +50,7 @@ jobs:
       - name: Install Depends
         run: brew install mbedtls@2
 
-      - name: Build And Test
+      - name: Build
         shell: bash
         run: |
           if [ "${{ matrix.EVENT_MATRIX }}" == "BREW_AUTODETECT_OPENSSL" ]; then
@@ -88,15 +88,21 @@ jobs:
           fi
           EVENT_CMAKE_OPTIONS="$EVENT_CMAKE_OPTIONS -DMBEDTLS_ROOT_DIR=/usr/local/opt/mbedtls@2"
 
-          #run build and test
-          JOBS=1
-          export CTEST_PARALLEL_LEVEL=$JOBS
-          export CTEST_OUTPUT_ON_FAILURE=1
           mkdir -p build
           cd build
           echo [cmake]: cmake .. $EVENT_CMAKE_OPTIONS
           cmake .. $EVENT_CMAKE_OPTIONS || (rm -rf * && cmake .. $EVENT_CMAKE_OPTIONS)
           cmake --build .
+
+      - name: Test
+        shell: bash
+        run: |
+          JOBS=1
+          export CTEST_PARALLEL_LEVEL=$JOBS
+          export CTEST_OUTPUT_ON_FAILURE=1
+
+          cd build
+
           if [ "${{ matrix.EVENT_MATRIX }}" == "TEST_EXPORT_STATIC" ]; then
             sudo python3 ../test-export/test-export.py static
           elif [ "${{ matrix.EVENT_MATRIX }}" == "TEST_EXPORT_SHARED" ]; then
@@ -140,7 +146,7 @@ jobs:
       - name: Install Depends
         run: brew install autoconf automake libtool pkg-config mbedtls@2
 
-      - name: Build And Test
+      - name: Build
         shell: bash
         run: |
           if [ "${{ matrix.EVENT_MATRIX }}" == "BREW_AUTODETECT_OPENSSL" ]; then
@@ -173,14 +179,18 @@ jobs:
             EVENT_CONFIGURE_OPTIONS=""
           fi
 
-          #run build and test
-          JOBS=1
           ./autogen.sh
           mkdir -p build
           cd build
           echo [configure]: ../configure $EVENT_CONFIGURE_OPTIONS
           ../configure $EVENT_CONFIGURE_OPTIONS
           make
+
+      - name: test
+        shell: bash
+        run: |
+          JOBS=1
+          cd build
           make -j $JOBS verify
 
       - uses: actions/upload-artifact@v1
index 2f8cd9b3f5c62e00a84e416d23be02c787a12921..2bfb309121688675af146deaabf04dd257c4aa12 100644 (file)
@@ -47,7 +47,7 @@ jobs:
           update: true
           install: mingw-w64-x86_64-gcc autoconf automake libtool mingw-w64-x86_64-openssl mingw-w64-x86_64-mbedtls pkg-config
 
-      - name: Build And Test
+      - name: Build
         shell: powershell
         run: |
           $env:EVENT_CONFIGURE_OPTIONS=""
@@ -57,7 +57,6 @@ jobs:
           elseif ( "${{ matrix.EVENT_MATRIX }}" -ne "none" ) {
             $env:EVENT_CONFIGURE_OPTIONS="--${{ matrix.EVENT_MATRIX }}"
           }
-          $env:EVENT_TESTS_PARALLEL=1
           $env:EVENT_BUILD_PARALLEL=10
 
           $script='
@@ -71,6 +70,18 @@ jobs:
           [[ $? -ne 0 ]] && exit 1
           make -j $EVENT_BUILD_PARALLEL 2>&1
           [[ $? -ne 0 ]] && exit 1
+          exit 0
+          '
+          D:\a\_temp\msys\msys64\usr\bin\bash.exe -c $script
+
+      - name: Test
+        shell: powershell
+        run: |
+          $env:EVENT_TESTS_PARALLEL=1
+
+          $script='
+          export PATH="/mingw64/bin:/usr/bin:/bin:/usr/local/bin:/opt/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:$PATH"
+          cd build
           make verify -j $EVENT_TESTS_PARALLEL 2>&1 '
           D:\a\_temp\msys\msys64\usr\bin\bash.exe -c $script
 
@@ -109,7 +120,7 @@ jobs:
           update: true
           install: mingw-w64-x86_64-gcc mingw-w64-x86_64-openssl mingw-w64-x86_64-mbedtls  
 
-      - name: Build And Test
+      - name: Build
         shell: powershell
         run: |
           $EVENT_CONFIGURE_OPTIONS=""
@@ -146,6 +157,11 @@ jobs:
           }
           cmake_configure 1
           cmake --build .
+
+      - name: Test
+        shell: powershell
+        run: |
+          cd build
           ctest -V
 
       - uses: actions/upload-artifact@v1
index d34482830d26cd52866cb5440b91e4b9445629c0..67169e585704ff73c07287ea088357eb8c87fd16 100644 (file)
@@ -46,11 +46,10 @@ jobs:
           vcpkgTriplet: x64-windows
           vcpkgGitCommitId: 7bc5b8cdfaf35329c1520b2af8d368e2b1cb78e6
 
-      - name: Build And Test
+      - name: Build
         shell: powershell
         run: |
           $EVENT_BUILD_PARALLEL=10
-          $EVENT_TESTS_PARALLEL=1
 
           mkdir build -ea 0
           cd build
@@ -84,18 +83,21 @@ jobs:
             }
           }
           cmake_configure 1
+          cmake --build . -j $EVENT_BUILD_PARALLEL -- /nologo /verbosity:minimal
 
-          try {
-            cmake --build . -j $EVENT_BUILD_PARALLEL -- /nologo /verbosity:minimal
-            if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
+      - name: Test
+        shell: powershell
+        run: |
+          $EVENT_TESTS_PARALLEL=1
 
+          cd build
+
+          try {
             if ("${{ matrix.EVENT_MATRIX }}" -eq "TEST_EXPORT_STATIC") {
               python ../test-export/test-export.py static
-            }
-            elseif ("${{ matrix.EVENT_MATRIX }}" -eq "TEST_EXPORT_SHARED") {
+            } elseif ("${{ matrix.EVENT_MATRIX }}" -eq "TEST_EXPORT_SHARED") {
               python ../test-export/test-export.py shared
-            }
-            else {
+            } else {
               ctest --output-on-failure -j $EVENT_TESTS_PARALLEL
               if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
             }
@@ -146,11 +148,10 @@ jobs:
           vcpkgTriplet: x64-windows
           vcpkgGitCommitId: 7bc5b8cdfaf35329c1520b2af8d368e2b1cb78e6
 
-      - name: Build And Test
+      - name: Build
         shell: powershell
         run: |
           $EVENT_BUILD_PARALLEL=10
-          $EVENT_TESTS_PARALLEL=1
 
           if ( "${{ matrix.EVENT_MATRIX }}" -eq "LIBRARY_TYPE_STATIC" ) {
             $EVENT_CMAKE_OPTIONS="-DEVENT__LIBRARY_TYPE=STATIC -DEVENT__MSVC_STATIC_RUNTIME=OFF"
@@ -220,18 +221,21 @@ jobs:
             }
           }
           cmake_configure 1
+          cmake --build . -j $EVENT_BUILD_PARALLEL -- /nologo /verbosity:minimal
 
-          try {
-            cmake --build . -j $EVENT_BUILD_PARALLEL -- /nologo /verbosity:minimal
-            if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
+      - name: Test
+        shell: powershell
+        run: |
+          $EVENT_TESTS_PARALLEL=1
 
+          cd build
+
+          try {
             if ("${{ matrix.EVENT_MATRIX }}" -eq "TEST_EXPORT_STATIC") {
               python ../test-export/test-export.py static
-            }
-            elseif ("${{ matrix.EVENT_MATRIX }}" -eq "TEST_EXPORT_SHARED") {
+            } elseif ("${{ matrix.EVENT_MATRIX }}" -eq "TEST_EXPORT_SHARED") {
               python ../test-export/test-export.py shared
-            }
-            else {
+            } else {
               ctest --output-on-failure -j $EVENT_TESTS_PARALLEL
               if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
             }