Skip to content

fix4

fix4 #68

Workflow file for this run

---
name: macOS
# Build and run tests on macOS
on:
- push
env:
CACHE_NUMBER: 0
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
macos_build:
name: macOS build
runs-on: macos-14
steps:
- name: Info
run: |
echo "macOS version: $(sw_vers -productVersion)"
- name: Disabling Spotlight
run: sudo mdutil -a -i off
- name: Uninstalling Homebrew
run: |
echo "Moving directories..."
sudo mkdir /opt/off
/usr/bin/sudo /usr/bin/find /usr/local -mindepth 1 -maxdepth 1 \
-type d -print -exec /bin/mv {} /opt/off/ \;
echo "Removing files..."
/usr/bin/sudo /usr/bin/find /usr/local -mindepth 1 -maxdepth 1 -type f \
-print -delete
hash -r
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
installer-url: "https://github.com/conda-forge/miniforge/releases/\
download/23.11.0-0/Mambaforge-23.11.0-0-MacOSX-arm64.sh"
activate-environment: grass-env
- name: Get cache date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Cache conda environment
uses: actions/cache@v4
with:
path: ~/miniconda3/envs/grass-env
key: conda-macos-arm64-${{
steps.get-date.outputs.today }}-${{
hashFiles('.github/workflows/macos_dependencies.txt') }}-${{
env.CACHE_NUMBER }}
id: cache
- name: Update environment
run: mamba env update -n grass-env -f .github/workflows/macos_dependencies.txt
if: steps.cache.outputs.cache-hit != 'true'
- name: Conda info
shell: bash -el {0}
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
$CC --version
- name: Create installation directory
run: mkdir $HOME/install
- name: Build and install
shell: bash -l {0}
run: source ./.github/workflows/macos_install.sh $HOME/install
- name: Add the bin directory to PATH
run: echo "$HOME/install/bin" >> $GITHUB_PATH
- name: Check installed version
shell: bash -l {0}
run: source ./.github/workflows/print_versions.sh
- name: Run tests
shell: bash -el {0}
run: >
grass --tmp-location XY --exec \
g.download.location url=${{ env.SampleData }} path=$HOME
grass --tmp-location XY --exec \
python3 -m grass.gunittest.main \
--grassdata $HOME --location nc_spm_full_v2alpha2 --location-type nc \
--min-success 100 --config .github/workflows/macos_gunittest.cfg
env:
SampleData: "https://grass.osgeo.org/sampledata/north_carolina/\
nc_spm_full_v2alpha2.tar.gz"
- name: Make HTML test report available
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: testreport-macOS
path: testreport
retention-days: 3