generated from riscv-software-src/template-riscv-code
-
Notifications
You must be signed in to change notification settings - Fork 58
89 lines (75 loc) · 2.71 KB
/
macos-build.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
on:
pull_request:
branches:
- master
env:
CACHE_VERSION: v1
name: Regress Olympia on MacOS
jobs:
build_test_job:
strategy:
# Strategy is a matrix of debug and release builds/regression
matrix:
os: [macos-12]
BUILD_TYPE: [Debug]
COMPILER: [clang]
name: MacOS-${{ matrix.BUILD_TYPE }}-${{matrix.COMPILER}}
runs-on: ${{ matrix.os }}
# Set up a global environment variable for build scripts
env:
OLYMPIA_BUILD_TYPE: ${{ matrix.BUILD_TYPE }}
COMPILER: ${{ matrix.COMPILER }}
steps:
# Get Olympia
- name: Checkout Olympia
uses: actions/checkout@v3
with:
submodules: recursive
# Get Sparta
- name: Checkout Sparta
uses: actions/checkout@v3
with:
repository: sparcians/map
path: map
ref: map_v2.0.13
# Setup Conda and build environment
- name: Grab Python v3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
# Cache the conda dependencies to
- name: Cache conda deps
uses: actions/cache@v3
with:
key: ${{ matrix.os }}-${{ matrix.BUILD_TYPE }}-${{ matrix.COMPILER }}-conda-${{ hashFiles('.github/workflows/conda/macos_env.yml') }}
path: /usr/share/miniconda/envs/riscv_perf_model # Default path for conda
# Setup CCache to cache builds
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os }}-${{ matrix.BUILD_TYPE }}-${{ matrix.COMPILER }}-ccache-${{ github.ref_name }}
restore-keys: |
${{ matrix.os }}-${{ matrix.BUILD_TYPE }}-${{ matrix.COMPILER }}-ccache-master
${{ matrix.os }}-${{ matrix.BUILD_TYPE }}-${{ matrix.COMPILER }}-ccache
- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
channels: conda-forge,defaults
channel-priority: true
activate-environment: riscv_perf_model
environment-file: .github/workflows/conda/macos_env.yml
# Build
- name: Build & Regress
run: ./.github/actions/build/entrypoint.sh
# Save error logs, etc
- name: Save artifacts
if: failure()
uses: actions/upload-artifact@main
with:
name: ErrorLogs-${{matrix.BUILD_TYPE}}-${{matrix.COMPILER}}
path: ${{matrix.BUILD_TYPE}}/test/
#- name: CTest
# # Run CTests without Valgrind tests otherwise the runtime will be TOO long
# if: ${{ env.DABBLE_BUILD_TYPE == 'release' }} && ${{ env.VALGRIND == 'false' }}
# uses: ./.github/actions/ctest # Uses an action.yml in directory