-
-
Notifications
You must be signed in to change notification settings - Fork 309
87 lines (85 loc) · 2.81 KB
/
macos.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
name: macOS
# Build and run tests on macOS
on:
push:
branches:
- main
- releasebranch_*
pull_request:
branches:
- main
- releasebranch_*
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-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: grass-env
use-mamba: true
- 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@v3
with:
path: ~/miniconda3/envs/grass-env
key: conda-macos-x86_64-${{
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@v3
with:
name: testreport-macOS
path: testreport
retention-days: 3