-
Notifications
You must be signed in to change notification settings - Fork 4
84 lines (72 loc) · 2.26 KB
/
run-tests.yaml
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
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
name: Run tests
jobs:
test:
name: Run tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: s2geography-dev
use-mamba: true
- name: Get Date
id: get-date
shell: bash -l {0}
# cache will last one day
run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')"
- name: Set environment file
id: env-file
shell: bash -l {0}
run: echo "env_file=ci/environment.yml" >> $GITHUB_ENV
- name: Check environment variables
id: check-env
run: |
echo "env.env_file: ${{ env.env_file }}"
- name: Cache environment
uses: actions/cache@v2
with:
path: ${{ env.CONDA }}/envs
key: ${{ runner.os }}-conda-${{ hashFiles( env.env_file ) }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if ci/environment.yml has not changed
CACHE_NUMBER: 0
id: conda-cache
- name: Update environment
run: mamba env update -n s2geography-dev -f ${{ env.env_file }}
if: steps.conda-cache.outputs.cache-hit != 'true'
- name: Conda info
shell: bash -l {0}
run: |
conda info
conda list
- name: Configure s2geography
shell: bash -l {0}
run: |
cmake -S . -B build \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DS2GEOGRAPHY_BUILD_TESTS=ON \
-DS2GEOGRAPHY_S2_SOURCE=CONDA
- name: Build s2geography
shell: bash -l {0}
run: |
cmake --build build --config Release
- name: Run tests
shell: bash -l {0}
run: |
cd build
ctest -T test --output-on-failure .