-
Notifications
You must be signed in to change notification settings - Fork 30
111 lines (98 loc) · 3.33 KB
/
ci-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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: CI MacOS
on:
workflow_call:
workflow_dispatch:
inputs:
force_debug_with_tmate:
type: boolean
description: 'Run the build with tmate session'
required: false
default: false
debug_with_tmate:
type: boolean
description: 'Run the build with a tmate session ONLY in case of failure'
required: false
default: false
pull_request:
merge_group:
push:
branches:
- main
concurrency:
group: ci-build-test-cpp-macos-${{ github.event.number || github.sha }}
cancel-in-progress: true
jobs:
build_and_ctest:
name: Build and Test (${{ matrix.runs-on }}, ASSERTIONS)
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [macos-12, macos-14]
env:
CACHE_DIR: ${{ github.workspace }}/.container-cache
CACHE_KEY: ${{ matrix.runs-on }}-build-test-cpp-asserts-v1-${{ format('{0}-{1}', github.ref_name, github.run_number) }}
steps:
- name: Set unified TZ
uses: szenius/[email protected]
with:
# this is an arbitrary choice
timezoneLinux: "Asia/Singapore"
timezoneMacos: "Asia/Singapore"
timezoneWindows: "Singapore Standard Time"
- name: "Checking out repository"
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
REPO_ADDRESS: ${{ github.server_url }}/${{ github.repository }}
run: |
git \
-c submodule."third_party/torch-mlir".update=none \
-c submodule."third_party/stablehlo".update=none \
-c submodule."src/runtime_src/core/common/aiebu".update=none \
clone \
--recursive \
--shallow-submodules \
--depth 1 \
-b $BRANCH_NAME $REPO_ADDRESS .
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install deps
run: |
brew install ccache ninja
- name: Python deps
run: |
pip install "numpy<2" pyyaml "pybind11[global]==2.10.3" nanobind
- name: Enable cache
uses: actions/cache/restore@v3
with:
path: ${{ env.CACHE_DIR }}
key: ${{ env.CACHE_KEY }}
restore-keys: ${{ matrix.runs-on }}-build-test-cpp-
- name: Build packages
run: |
export cache_dir="${{ env.CACHE_DIR }}"
export CCACHE_COMPILERCHECK="string:$(clang --version)"
bash build_tools/ci/build_test_cpp.sh
- name: Create artifacts
if: ${{ !cancelled() }}
run: |
tar cf iree-dist-${{ matrix.runs-on }}.tar iree-install
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: ${{ matrix.runs-on }}_release_packages
path: iree-dist-${{ matrix.runs-on }}.tar
if-no-files-found: warn
- name: Save cache
uses: actions/cache/save@v3
if: ${{ !cancelled() && github.event_name == 'push' && github.ref_name == 'main' }}
with:
path: ${{ env.CACHE_DIR }}
key: ${{ env.CACHE_KEY }}
- name: Start tmate session
if: ${{ (failure() && inputs.debug_with_tmate) || inputs.force_debug_with_tmate }}
uses: mxschmitt/[email protected]
with:
limit-access-to-actor: true