This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
73 lines (60 loc) · 2.31 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
name: MacOS Build and Test
on:
push:
branches: [ main, fbsync ]
pull_request:
branches:
- main
- fbsync
# For PR created by ghstack
- gh/*/*/base
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: macos-latest
steps:
- name: Setup Python environment
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Check out source repository
uses: actions/checkout@v2
with:
submodules: recursive
# Based on https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
run: |
echo "::set-output name=timestamp::$(/bin/date -u "+%Y%m%d-%H:%M:%S")"
shell: bash
- name: Load ccache files
uses: actions/cache@v2
with:
path: .ccache
key: macos-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
macos-ccache-
- name: Install dependencies from Brew
run: |
brew install --formula ninja flex bison cmake ccache icu4c boost gflags glog libevent
# Based on https://github.com/facebookincubator/velox/blob/99429407c3d524e07b32b8b19a03aa7382f819cf/.circleci/config.yml#L114-L116
- name: Configure ccache
run: |
echo "$GITHUB_WORKSPACE"
CCACHE_DIR=$GITHUB_WORKSPACE/.ccache ccache -sz -M 5G
- name: Build and install other dependencies
run: MACOSX_DEPLOYMENT_TARGET=10.15 CPU_TARGET="sse" CMAKE_C_COMPILER_LAUNCHER=ccache CMAKE_CXX_COMPILER_LAUNCHER=ccache CCACHE_DIR=$GITHUB_WORKSPACE/.ccache scripts/build_mac_dep.sh ranges_v3 fmt double_conversion folly re2
- name: Bulid TorchArrow
run: |
CCACHE_DIR=$GITHUB_WORKSPACE/.ccache ccache -sz
MACOSX_DEPLOYMENT_TARGET=10.15 CPU_TARGET="sse" CCACHE_DIR=$GITHUB_WORKSPACE/.ccache python setup.py develop
- name: Print CCache Stats
run: CCACHE_DIR=$GITHUB_WORKSPACE/.ccache ccache -s
- name: Install dependencies for test
run: |
pip3 install pytest
pip3 install torch
- name : Run TorchArrow unit tests
run: |
pytest --no-header -v torcharrow/test