Skip to content

Commit

Permalink
Merge pull request #4020 from rouault/ci_mac_arm64
Browse files Browse the repository at this point in the history
CI: add a M1 ARM64 MacOS runner
  • Loading branch information
rouault authored Jan 31, 2024
2 parents 107c80a + b6ccd38 commit 3cc757f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 11 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,35 @@ concurrency:
jobs:

macos_build:
runs-on: macos-latest
strategy:
fail-fast: true
matrix:
include:
- platform: "macos-latest"
architecture: "x64"
# macOS-14 is a M1 ARM64 MacOS runner: https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/
- platform: "macOS-14"
architecture: "arm64"

runs-on: ${{ matrix.platform }}

if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:

- uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v2
- uses: mamba-org/setup-micromamba@v1
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
init-shell: bash
environment-file: .github/workflows/mac/environment.yml

- name: Cache
uses: actions/cache@v3
id: cache
with:
path: ${{ github.workspace }}/.ccache
key: ${{ runner.os }}-cache-mac-${{ github.run_id }}
restore-keys: ${{ runner.os }}-cache-mac-
key: ${{ runner.os }}-cache-mac-${{ matrix.architecture }}-${{ github.run_id }}
restore-keys: ${{ runner.os }}-cache-mac-${{ matrix.architecture }}-

- name: Install Requirements
shell: bash -l {0}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/mac/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

set -e

mamba install --yes --quiet compilers
mamba install --yes --quiet python=3.8 autoconf automake libtool pkg-config ccache jsonschema
mamba install --yes --quiet --only-deps proj=7.1.1=h45baca5_3
mamba install --yes --quiet --only-deps proj
16 changes: 16 additions & 0 deletions .github/workflows/mac/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: proj
channels:
- conda-forge
dependencies:
- python=3.8
- conda
- mamba
- compilers
- ninja
- cmake
- pkg-config
- ccache
- autoconf
- automake
- jsonschema

3 changes: 2 additions & 1 deletion test/gie/builtins.gie
Original file line number Diff line number Diff line change
Expand Up @@ -7238,7 +7238,8 @@ expect failure errno coord_transfm_outside_projection_domain
-------------------------------------------------------------------------------
operation +proj=vandg +a=6400000 +over
-------------------------------------------------------------------------------
tolerance 0.25 mm
# 0.25 is OK for Intel platforms, but on Mac M1 ARM64 we need 0.35
tolerance 0.35 mm

accept 2 1
expect 223395.249543407 111704.596633675
Expand Down
3 changes: 3 additions & 0 deletions travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ else
USE_CCACHE=OFF
fi

# Ensure directory exists for PROJ_DB_CACHE_DIR
mkdir -p $HOME/.ccache

if test "x${CMAKE_BUILD_TYPE}" = "x"; then
CMAKE_BUILD_TYPE=Release
fi
Expand Down

0 comments on commit 3cc757f

Please sign in to comment.