Repository: coqui-ai/STT (language: python)

Issue:
Migrate away from deprecated macos-10.15 workers
https://github.com/actions/virtual-environments/issues/5583

We should bump jobs to macos-12 and verify they all work.


Discussion / hints:

Fix patch:
diff --git a/ci_scripts/tf-vars.sh b/ci_scripts/tf-vars.sh
index 3ac7e7052..116d3324c 100755
--- a/ci_scripts/tf-vars.sh
+++ b/ci_scripts/tf-vars.sh
@@ -118,12 +118,12 @@ elif [ "${OS}" = "Darwin" ]; then
     if [ "$FROM" = "darwin-x86_64" -a "$TO" = "darwin-x86_64" ]; then
         BAZEL_OPT_FLAGS="--copt=-mtune=generic --copt=-march=x86-64 --copt=-msse --copt=-msse2 --copt=-msse3 --copt=-msse4.1 --copt=-msse4.2 --copt=-mavx"
         if [ "${CI}" = true ]; then
-            BAZEL_EXTRA_FLAGS="${BAZEL_EXTRA_FLAGS} --macos_minimum_os 10.10 --macos_sdk_version 10.15"
+            BAZEL_EXTRA_FLAGS="${BAZEL_EXTRA_FLAGS} --macos_minimum_os 10.10 --macos_sdk_version 12.0"
         fi
     elif [ "$FROM" = "darwin-x86_64" -a "$TO" = "darwin-arm64" ]; then
         BAZEL_OPT_FLAGS=""
         if [ "${CI}" = true ]; then
-            BAZEL_EXTRA_FLAGS="--config=macos_arm64 --xcode_version 12.2 --macos_minimum_os 11.0 --macos_sdk_version 11.0"
+            BAZEL_EXTRA_FLAGS="--config=macos_arm64 --xcode_version 13.1 --macos_minimum_os 11.0 --macos_sdk_version 12.0"
         fi
     elif [ "$FROM" = "darwin-arm64" -a "$TO" = "darwin-arm64" ]; then
         BAZEL_OPT_FLAGS=""


Test patch:
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
index 37f8468cb..b18f47eea 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -1429,7 +1429,7 @@ jobs:
   # macOS jobs
   swig_macOS:
     name: "Mac|Build SWIG"
-    runs-on: macos-10.15
+    runs-on: macos-12
     env:
       swig_hash: "90cdbee6a69d13b39d734083b9f91069533b0d7b"
     steps:
@@ -1472,7 +1472,7 @@ jobs:
   build-ctc-decoder-macos:
     name: "Mac|Build CTC decoder Python package"
     needs: [ swig_macOS ]
-    runs-on: macos-10.15
+    runs-on: macos-12
     strategy:
       matrix:
         python-version: [3.6.8, 3.7.9, 3.8.9, 3.9.4, 3.10.1]
@@ -1515,7 +1515,7 @@ jobs:
   train-test-model-macOS:
     name: "Mac|Train a test model"
     needs: [ "build-ctc-decoder-macos" ]
-    runs-on: macos-10.15
+    runs-on: macos-12
     if: ${{ github.event_name == 'pull_request' }}
     strategy:
       matrix:
@@ -1571,7 +1571,7 @@ jobs:
           path: ${{ github.workspace }}/tmp/checkpoint.tar.xz
   build-lib-macOS:
     name: "Mac|Build libstt+client"
-    runs-on: macos-10.15
+    runs-on: macos-12
     strategy:
       matrix:
         arch: ["x86_64", "arm64"]
@@ -1588,13 +1588,7 @@ jobs:
           brew install coreutils
       - name: Select Xcode version
         run: |
-          if [ "${{ matrix.arch }}" = "arm64" ]; then
-            sudo xcode-select --switch /Applications/Xcode_12.2.app/Contents/Developer
-            # Force set 11.0 SDK for `stt` binary build, xcrun always uses CLT SDK
-            export SDKROOT=/Applications/Xcode_12.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk
-          else
-            sudo xcode-select --switch /Applications/Xcode_12.1.1.app/Contents/Developer
-          fi
+          sudo xcode-select --switch /Applications/Xcode_13.1.app/Contents/Developer
       - uses: actions/cache@v2
         id: cache
         if: matrix.arch == 'arm64'
@@ -1632,9 +1626,6 @@ jobs:
         run: |
           sudo rm -r /Library/Developer/CommandLineTools
       - run: ./ci_scripts/host-build.sh ${{ matrix.arch }}
-      - name: Setup tmate session
-        uses: mxschmitt/action-tmate@v3
-        if: failure()
       - run: ./ci_scripts/package.sh
       - uses: actions/upload-artifact@v2
         with:
@@ -1646,7 +1637,7 @@ jobs:
           path: ${{ github.workspace }}/artifacts/libstt.zip
   build-lib-iOS:
     name: "iOS|Build libstt+client"
-    runs-on: macos-10.15
+    runs-on: macos-12
     steps:
       - uses: actions/checkout@v2
         with:
@@ -1660,7 +1651,7 @@ jobs:
           brew install coreutils
       - name: Select Xcode version
         run: |
-          sudo xcode-select --switch /Applications/Xcode_12.2.app/Contents/Developer
+          sudo xcode-select --switch /Applications/Xcode_13.1.app/Contents/Developer
       - run: ./ci_scripts/tf-setup.sh
       - name: Workaround problems with mixing headers from Xcode and CommandLineTools by removing the latter
         run: |
@@ -1682,7 +1673,7 @@ jobs:
           path: ${{ github.workspace }}/artifacts/ios_artifacts.zip
   build-universal-lib-macOS:
     name: "Mac|Build universal lib"
-    runs-on: macos-10.15
+    runs-on: macos-12
     needs: [build-lib-macOS]
     steps:
       # Download and extract individual arch packages and create universal binaries
@@ -1746,7 +1737,7 @@ jobs:
           path: libstt.zip
   build-python-macOS:
     name: "Mac|Build Python bindings"
-    runs-on: macos-10.15
+    runs-on: macos-12
     needs: [build-universal-lib-macOS, swig_macOS]
     strategy:
       matrix:
@@ -1792,7 +1783,7 @@ jobs:
           path: ${{ github.workspace }}/native_client/python/dist/*.whl
   build-nodejs-macOS:
     name: "Mac|Build NodeJS and ElectronJS"
-    runs-on: macos-10.15
+    runs-on: macos-12
     needs: [build-universal-lib-macOS, swig_macOS]
     steps:
       - uses: actions/checkout@v2
@@ -1841,7 +1832,7 @@ jobs:
           path: ${{ github.workspace }}/native_client/javascript/stt-*.tgz
   test-cpp-macOS:
     name: "Mac|Test C++ binary"
-    runs-on: macos-10.15
+    runs-on: macos-12
     needs: [build-universal-lib-macOS, train-test-model-Linux]
     if: ${{ github.event_name == 'pull_request' }}
     strategy:
@@ -1877,7 +1868,7 @@ jobs:
           model-kind: ${{ matrix.models }}
   test-py-macOS:
     name: "Mac|Test Python bindings"
-    runs-on: macos-10.15
+    runs-on: macos-12
     needs: [build-python-macOS, train-test-model-Linux]
     if: ${{ github.event_name == 'pull_request' }}
     strategy:
@@ -1917,7 +1908,7 @@ jobs:
           model-kind: ${{ matrix.models }}
   test-nodejs-macOS:
     name: "Mac|Test NodeJS bindings"
-    runs-on: macos-10.15
+    runs-on: macos-12
     needs: [build-nodejs-macOS, train-test-model-Linux]
     if: ${{ github.event_name == 'pull_request' }}
     strategy:
@@ -1967,7 +1958,7 @@ jobs:
           model-kind: ${{ matrix.models }}
   test-electronjs-macOS:
     name: "Mac|Test ElectronJS bindings"
-    runs-on: macos-10.15
+    runs-on: macos-12
     needs: [build-nodejs-macOS, train-test-model-Linux]
     if: ${{ github.event_name == 'pull_request' }}
     strategy:
@@ -2060,9 +2051,6 @@ jobs:
           make -C native_client/ctcdecode/ \
             NUM_PROCESSES=$(nproc) \
             bindings
-      - name: Setup tmate session
-        uses: mxschmitt/action-tmate@v3
-        if: failure()
       - uses: actions/upload-artifact@v2
         with:
           name: "coqui_stt_ctcdecoder-windows-test.whl"
@@ -2166,9 +2154,6 @@ jobs:
         with:
           numpy_build: "${{ steps.get_numpy.outputs.build_version }}"
           numpy_dep: "${{ steps.get_numpy.outputs.dep_version }}"
-      - name: Setup tmate session
-        uses: mxschmitt/action-tmate@v3
-        if: failure()
       - uses: actions/upload-artifact@v2
         with:
           name: "stt-tflite-${{ matrix.python-version }}-Windows.whl"
@@ -2611,7 +2596,7 @@ jobs:
         timeout-minutes: 5
   test-nodejs_all-macOS:
     name: "Mac|Test MultiArchPlatform NodeJS bindings"
-    runs-on: macos-10.15
+    runs-on: macos-12
     needs: [repackage-nodejs-allplatforms, train-test-model-Linux]
     if: ${{ github.event_name == 'pull_request' }}
     strategy:
@@ -2661,7 +2646,7 @@ jobs:
           model-kind: ${{ matrix.models }}
   test-electronjs_all-macOS:
     name: "Mac|Test MultiArchPlatform ElectronJS bindings"
-    runs-on: macos-10.15
+    runs-on: macos-12
     needs: [repackage-nodejs-allplatforms, train-test-model-Linux]
     if: ${{ github.event_name == 'pull_request' }}
     strategy:
@@ -3563,9 +3548,9 @@ jobs:
           ndk-version: r19c
           add-to-path: false
       # This particular version of CMake confuses Gradle by not being semver.
-      # We're fine with 3.10.2 which is also installed. Keep an eye on the
+      # We're fine with 3.22.1 which is also installed. Keep an eye on the
       # virtual environments though:
-      # https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md#android
+      # https://github.com/actions/virtual-environments/blob/main/images/macos/macos-12-Readme.md#android
       - name: Remove CMake 3.18.1-g262b901
         run: |
           ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --uninstall 'cmake;3.18.1'