From 70f2bd5f31c5359bf6b751e61d326e0ee24c1a38 Mon Sep 17 00:00:00 2001
From: "Alexander V. Tikhonov" <avtikhon@tarantool.org>
Date: Fri, 11 Dec 2020 16:53:06 +0300
Subject: [PATCH] github-ci: implement OSX commit testing

Implemented github-ci action workflow OSX jobs on commits:
 - OSX 10.15
 - OSX 11.0

Part of #5294
---
 .github/workflows/osx_10_15.yml | 28 ++++++++++++++++++++++++++++
 .github/workflows/osx_11_0.yml  | 28 ++++++++++++++++++++++++++++
 .travis.mk                      | 13 +++++++++++--
 3 files changed, 67 insertions(+), 2 deletions(-)
 create mode 100644 .github/workflows/osx_10_15.yml
 create mode 100644 .github/workflows/osx_11_0.yml

diff --git a/.github/workflows/osx_10_15.yml b/.github/workflows/osx_10_15.yml
new file mode 100644
index 0000000000..f4a826d9ae
--- /dev/null
+++ b/.github/workflows/osx_10_15.yml
@@ -0,0 +1,28 @@
+name: CI
+
+on: [push, pull_request]
+
+env:
+  CI_MAKE: make -f .travis.mk
+
+jobs:
+  osx_10_15:
+    runs-on: macos-10.15
+
+    strategy:
+      fail-fast: false
+
+    steps:
+      - uses: actions/checkout@v2.3.4
+        with:
+          fetch-depth: 0
+          submodules: recursive
+      - name: test
+        run: ${CI_MAKE} test_osx_github_actions
+      - name: artifacts
+        uses: actions/upload-artifact@v2
+        if: failure()
+        with:
+          name: osx_10_15
+          retention-days: 1000000
+          path: test/var/artifacts
diff --git a/.github/workflows/osx_11_0.yml b/.github/workflows/osx_11_0.yml
new file mode 100644
index 0000000000..c4a0c269fe
--- /dev/null
+++ b/.github/workflows/osx_11_0.yml
@@ -0,0 +1,28 @@
+name: CI
+
+on: [push, pull_request]
+
+env:
+  CI_MAKE: make -f .travis.mk
+
+jobs:
+  osx_11_0:
+    runs-on: macos-11.0
+
+    strategy:
+      fail-fast: false
+
+    steps:
+      - uses: actions/checkout@v2.3.4
+        with:
+          fetch-depth: 0
+          submodules: recursive
+      - name: test
+        run: ${CI_MAKE} test_osx_github_actions
+      - name: artifacts
+        uses: actions/upload-artifact@v2
+        if: failure()
+        with:
+          name: osx_11_0
+          retention-days: 1000000
+          path: test/var/artifacts
diff --git a/.travis.mk b/.travis.mk
index a975cd3ccc..f282a9cee9 100644
--- a/.travis.mk
+++ b/.travis.mk
@@ -237,8 +237,9 @@ test_oos_build:
 #######
 
 # since Python 2 is EOL it's latest commit from tapped local formula is used
-OSX_PKGS=openssl readline curl icu4c libiconv zlib autoconf automake libtool \
-	cmake file://$${PWD}/tools/brew_taps/tntpython2.rb
+OSX_PKGS_MIN=openssl readline curl icu4c libiconv zlib autoconf automake libtool \
+	cmake
+OSX_PKGS=${OSX_PKGS_MIN} file://$${PWD}/tools/brew_taps/tntpython2.rb
 
 deps_osx:
 	# install brew using command from Homebrew repository instructions:
@@ -253,6 +254,12 @@ deps_osx:
 	brew install --force ${OSX_PKGS} || brew upgrade ${OSX_PKGS}
 	pip install --force-reinstall -r test-run/requirements.txt
 
+deps_osx_github_actions:
+	# try to install the packages either upgrade it to avoid of fails
+	# if the package already exists with the previous version
+	brew install --force ${OSX_PKGS_MIN} || brew upgrade ${OSX_PKGS_MIN}
+	pip install --force-reinstall -r test-run/requirements.txt
+
 build_osx:
 	cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
 	make -j
@@ -283,6 +290,8 @@ test_osx_no_deps: build_osx
 
 test_osx: deps_osx test_osx_no_deps
 
+test_osx_github_actions: deps_osx_github_actions test_osx_no_deps
+
 # Static macOS build
 
 STATIC_OSX_PKGS=autoconf automake libtool cmake file://$${PWD}/tools/brew_taps/tntpython2.rb
-- 
GitLab