Skip to content

ci: fix macos tests #3085

ci: fix macos tests

ci: fix macos tests #3085

Workflow file for this run

name: Full CI
on:
push:
branches:
- master
pull_request:
types: [synchronize, labeled]
pull_request_target:
types: [labeled]
env:
GO_VERSION: '>=1.21.5'
PYTHON_VERSION: '3.10'
jobs:
full-ci-ce:
if: |
(github.event_name == 'push') ||
(github.event_name == 'pull_request' &&
github.event.action == 'labeled' &&
github.event.label.name == 'full-ci') ||
(github.event_name == 'pull_request' &&
github.event.action == 'synchronize' &&
contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: ubuntu-20.04
strategy:
matrix:
tarantool-version: ["1.10", "2.10", "3.0"]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Prepare CE env
uses: ./.github/actions/prepare-ce-test-env
with:
tarantool-version: '${{ matrix.tarantool-version }}'
- name: Static code check
uses: ./.github/actions/static-code-check
- name: Unit tests
run: mage unitfull
# This server starts and listen on 8084 port that is used for tests.
- name: Stop Mono server
run: sudo systemctl kill mono-xsp4 || true
- name: Integration tests
run: mage integrationfull
full-ci-ce-linux-arm64:
if: false
runs-on: graviton
strategy:
fail-fast: false
container:
image: tarantool/testing:tt-build
options: '--init --privileged'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Install test requirements
run: |
pip3 install setuptools==59.5.0
pip3 install -r test/requirements.txt
shell: bash
- name: Install etcd
uses: ./.github/actions/setup-etcd
- name: Build test
run: mage build
- name: Unit tests
run: mage unit:fullSkipDocker
- name: Integration tests
run: mage integrationfullskipdocker
full-ci-sdk:
# Tests will run only when the pull request is labeled with `full-ci`. To
# avoid security problems, the label must be reset manually for every run.
#
# We need to use `pull_request_target` because it has access to base
# repository secrets unlike `pull_request`.
if: (github.event_name == 'push') ||
(github.event_name == 'pull_request_target' &&
github.event.action == 'labeled' &&
github.event.label.name == 'full-ci') ||
(github.event_name == 'pull_request' &&
github.event.action == 'synchronize' &&
github.event.pull_request.head.repo.full_name == github.repository &&
contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: ubuntu-20.04
strategy:
matrix:
sdk-version:
- "2.11.2-0-r609.linux.x86_64"
- "3.2.0-0-r40.linux.x86_64"
fail-fast: false
steps:
# `ref` as merge request is needed for pull_request_target because this
# target runs in the context of the base commit of the pull request.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
- name: Prepare EE env
uses: ./.github/actions/prepare-ee-test-env
with:
sdk-version: '${{ matrix.sdk-version }}'
sdk-download-token: '${{ secrets.SDK_DOWNLOAD_TOKEN }}'
- name: Static code check
uses: ./.github/actions/static-code-check
- name: Unit tests
run: mage unitfull
# This server starts and listen on 8084 port that is used for tests.
- name: Stop Mono server
run: sudo systemctl kill mono-xsp4 || true
- name: Integration tests
run: mage integrationfull
full-ci-macOS:
if: |
(github.event_name == 'push') ||
(github.event_name == 'pull_request' &&
github.event.action == 'labeled' &&
github.event.label.name == 'full-ci') ||
(github.event_name == 'pull_request' &&
github.event.action == 'synchronize' &&
contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: [self-hosted, macOS-13-self-hosted, x86_64, regular]
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
brew install --overwrite go mage wget node docker colima docker-credential-helper
pip3 install -r test/requirements.txt
- name: Install etcd
uses: ./.github/actions/setup-etcd
- name: Build tt
env:
TT_CLI_BUILD_SSL: 'static'
run: mage build
# - name: Install tarantool
# run: |
# ./tt init
# ./tt install tarantool 3.0.2
# # Delete the tt config so that it does not affect the test environment.
# rm -f tt.yaml
#
# - name: Add Tarantool to Path
# run: |
# echo "${GITHUB_WORKSPACE}/bin" >> $GITHUB_PATH
- name: Set Tarantool include directory to the environment
run: |
echo "TT_CLI_TARANTOOL_PREFIX=${GITHUB_WORKSPACE}/include/" >> $GITHUB_ENV
- name: Start colima and patch mount options
# Also we need to delete line with 'credSotre' to download docker image.
run: |
colima start --vm-type vz --mount /private/var/folders:w
- name: Print docker config
run: |
cat ~/.docker/config.json
docker rmi -f $(docker images -aq)
- name: Docker build
run: docker build -t ubuntu:tt_test cli/docker/testdata/
- name: Run unit tests
# run: mage -v unitfull
run: go test -C cli/docker -tags integration,integration_docker
- name: Integration tests
run: mage integrationfull
# Etcd can be still running after integration tests when:
# 1. pytest recieve SIGALRM (can be caused by pytest-timeout plugin)
# 2. when pytest crashes
# In both cases finalizers are not invoked, so etcd is not stopped.
- name: Kill etcd, if it was left after integration tests
if: always()
run: |
ETCD_TT_BIN=${ETCD_PATH}etcd;
pkill -SIGINT -f ${ETCD_TT_BIN} || true
- name: Kill tarantool, if it was left
if: always()
run: |
TARANTOOL_BIN=${GITHUB_WORKSPACE}/bin/tarantool;
pkill -SIGINT -f ${TARANTOOL_BIN} || true
- name: Kill colima
if: always()
run: colima delete
# ee suffix means that the job runs ee integration tests.
full-ci-macOS-ee:
if: |
(github.event_name == 'push') ||
(github.event_name == 'pull_request_target' &&
github.event.action == 'labeled' &&
github.event.label.name == 'full-ci') ||
(github.event_name == 'pull_request' &&
github.event.action == 'synchronize' &&
github.event.pull_request.head.repo.full_name == github.repository &&
contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: macos-12
steps:
# `ref` as merge request is needed for pull_request_target because this
# target runs in the context of the base commit of the pull request.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
brew install --overwrite go mage
brew install python3
pip3 install -r test/requirements.txt
- name: Build tt
env:
TT_CLI_BUILD_SSL: 'static'
run: mage build
- name: Integration tests
env:
TT_CLI_EE_USERNAME: '${{ secrets.TT_EE_USERNAME }}'
TT_CLI_EE_PASSWORD: '${{ secrets.TT_EE_PASSWORD }}'
run: mage integrationee
# sdk suffix means the tests will be run on tarantool from EE SDK package.
# ee suffix means that the job runs EE integration tests.
full-ci-sdk-ee:
# Tests will run only when the pull request is labeled with `full-ci`. To
# avoid security problems, the label must be reset manually for every run.
#
# We need to use `pull_request_target` because it has access to base
# repository secrets unlike `pull_request`.
if: (github.event_name == 'push') ||
(github.event_name == 'pull_request_target' &&
github.event.action == 'labeled' &&
github.event.label.name == 'full-ci') ||
(github.event_name == 'pull_request' &&
github.event.action == 'synchronize' &&
github.event.pull_request.head.repo.full_name == github.repository &&
contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: ubuntu-20.04
strategy:
matrix:
sdk-version:
- "2.11.2-0-r609.linux.x86_64"
- "3.2.0-0-r40.linux.x86_64"
fail-fast: false
steps:
# `ref` as merge request is needed for pull_request_target because this
# target runs in the context of the base commit of the pull request.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
- name: Prepare EE env
uses: ./.github/actions/prepare-ee-test-env
with:
sdk-version: '${{ matrix.sdk-version }}'
sdk-download-token: '${{ secrets.SDK_DOWNLOAD_TOKEN }}'
- name: Install dependencies
run: |
pip3 install -r test/requirements.txt
- name: Integration tests
env:
TT_CLI_EE_USERNAME: '${{ secrets.TT_EE_USERNAME }}'
TT_CLI_EE_PASSWORD: '${{ secrets.TT_EE_PASSWORD }}'
run: mage integrationee
# ce suffix means that the job will be run on CE tarantool.
# ee suffix means that the job runs EE integration tests.
full-ci-ce-ee:
if: |
(github.event_name == 'push') ||
(github.event_name == 'pull_request_target' &&
github.event.action == 'labeled' &&
github.event.label.name == 'full-ci') ||
(github.event_name == 'pull_request' &&
github.event.action == 'synchronize' &&
github.event.pull_request.head.repo.full_name == github.repository &&
contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: ubuntu-20.04
strategy:
matrix:
tarantool-version: ["1.10", "2.10"]
fail-fast: false
steps:
# `ref` as merge request is needed for pull_request_target because this
# target runs in the context of the base commit of the pull request.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 0
submodules: recursive
- name: Prepare CE env
uses: ./.github/actions/prepare-ce-test-env
with:
tarantool-version: '${{ matrix.tarantool-version }}'
- name: Install dependencies
run: |
pip3 install -r test/requirements.txt
- name: Integration tests
env:
TT_CLI_EE_USERNAME: '${{ secrets.TT_EE_USERNAME }}'
TT_CLI_EE_PASSWORD: '${{ secrets.TT_EE_PASSWORD }}'
run: mage integrationee
# Integration tests on the system without Tarantool installed.
full-ci-ce-no-tarantool:
if: |
(github.event_name == 'push') ||
(github.event_name == 'pull_request' &&
github.event.action == 'labeled' &&
github.event.label.name == 'full-ci') ||
(github.event_name == 'pull_request' &&
github.event.action == 'synchronize' &&
contains(github.event.pull_request.labels.*.name, 'full-ci'))
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Prepare CE env
uses: ./.github/actions/prepare-ce-test-env
with:
tarantool-version: '2.10.6'
skip-tarantool-install: true
- name: Install dependencies
run: |
pip3 install -r test/requirements.txt
- name: Integration tests
run: mage integrationnotarantool