Skip to content

macOS Build Check

macOS Build Check #429

Workflow file for this run

# Copyright (C) 2022 Dremio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Projectnessie GitHub Pull-Request / macOS CI
name: macOS Build Check
on:
pull_request:
types: [labeled, opened, synchronize, reopened]
schedule:
# Run daily on week days
- cron: '0 4 * * 1-5'
workflow_dispatch:
jobs:
java:
name: Java/Gradle macOS
runs-on: macos-12
if: (github.repository == 'projectnessie/nessie' && github.event_name != 'pull_request') || contains(github.event.pull_request.labels.*.name, 'pr-macos-win')
env:
SPARK_LOCAL_IP: localhost
CI_MAC: "true"
steps:
- name: Brew update & upgrade
run: |
echo "::group::Update Brew"
brew update
echo "::endgroup::"
echo "::group::Brew Upgrade"
brew upgrade || true
echo "::endgroup::"
- name: Prepare Podman
run: |
echo "::group::Install Podman"
brew install podman
echo "::endgroup::"
echo "::group::Initializing Podman"
podman machine init
echo "::endgroup::"
- name: Start Podman
uses: nick-fields/retry@v2
with:
max_attempts: 10
timeout_minutes: 5
retry_wait_seconds: 3
command: |
echo "::group::Starting Podman"
podman machine start
echo "::endgroup::"
on_retry_command: |
echo "::group::Stopping Podman"
podman machine stop
echo "::endgroup::"
- name: Configure Podman
run: |
echo "::group::Aliasing Podman"
ln -s /usr/local/bin/podman /usr/local/bin/docker
echo "::endgroup::"
export DOCKER_HOST="unix:///${HOME}/.local/share/containers/podman/machine/podman-machine-default/podman.sock"
echo "DOCKER_HOST=$DOCKER_HOST" >> ${GITHUB_ENV}
# See https://www.testcontainers.org/supported_docker_environment/
echo "TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock" >> ${GITHUB_ENV}
echo "::group::Docker info"
docker info
echo "::endgroup::"
- uses: actions/checkout@v3.5.2
- name: Setup Java, Gradle
uses: ./.github/actions/dev-tool-java
- name: Gradle / compile
uses: gradle/gradle-build-action@v2
env:
# Same as for ci.yml
GRADLE_BUILD_ACTION_CACHE_KEY_ENVIRONMENT: java-11
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: nessie-ci
GRADLE_BUILD_ACTION_CACHE_KEY_JOB_INSTANCE: ci
with:
cache-read-only: true
arguments: assemble --scan
- name: Gradle / unit test
uses: gradle/gradle-build-action@v2
env:
SPARK_LOCAL_IP: localhost
with:
arguments: test --scan
- name: Gradle / check incl. integ-test
uses: gradle/gradle-build-action@v2
with:
arguments: check --scan
- name: Capture Test Reports
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: test-results
path: |
**/build/reports/*
**/build/test-results/*
retention-days: 3
python:
name: Python macOS
runs-on: macos-12
if: (github.repository == 'projectnessie/nessie' && github.event_name != 'pull_request') || contains(github.event.pull_request.labels.*.name, 'pr-macos-win')
env:
working-directory: ./python
strategy:
max-parallel: 1
matrix:
python-version: ['3.8', '3.9', '3.10', '3.7']
steps:
- uses: actions/checkout@v3.5.2
- name: Setup Python
uses: ./.github/actions/dev-tool-python
with:
python-version: ${{ matrix.python-version }}
- name: Test with tox
run: tox
working-directory: ${{env.working-directory}}