-
Notifications
You must be signed in to change notification settings - Fork 25
93 lines (81 loc) · 2.75 KB
/
main.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
name: CI
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
steps:
- uses: actions/checkout@v3
- name: Prepare CI config
run: cp Makefiles/sledconf.ci ./sledconf
- name: Build
run: make
- name: Test
run: ./sled
nspire:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: sled
- name: Checkout ndless
uses: actions/checkout@v3
with:
repository: ndless-nspire/Ndless
path: ndless
submodules: 'recursive'
fetch-depth: 0 # submodule checkout breaks with depth=1
# store the commit hash for caching later
- working-directory: ndless
run: |
echo "NDLESS_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
## toolchain
- uses: actions/cache@v3
id: toolchain-cache
with:
path: ndless/ndless-sdk/toolchain/install
# gcc/binutils/etc versions are in build_toolchain.sh
key: ${{ runner.os }}-${{ hashFiles('ndless/ndless-sdk/toolchain/build_toolchain.sh') }}
- name: Install ndless toolchain dependencies
if: steps.toolchain-cache.outputs.cache-hit != 'true'
run: sudo apt install -y libmpfr-dev libmpc-dev
- name: Set up ndless toolchain
if: steps.toolchain-cache.outputs.cache-hit != 'true'
working-directory: ndless/ndless-sdk/toolchain
run: ./build_toolchain.sh
- name: Add ndless SDK to path
run: echo "$GITHUB_WORKSPACE/ndless/ndless-sdk/bin" >> $GITHUB_PATH
# ndless SDK
- uses: actions/cache@v3
id: sdk-cache
with:
path: ndless/ndless-sdk
key: ${{ runner.os }}-${{ env.NDLESS_SHA }}
- name: Add toolchain to path
if: steps.sdk-cache.outputs.cache-hit != 'true'
run: echo "$GITHUB_WORKSPACE/ndless/ndless-sdk/toolchain/install/bin" >> $GITHUB_PATH
- name: Install ndless SDK dependencies
if: steps.sdk-cache.outputs.cache-hit != 'true'
run: sudo apt install -y libboost-program-options-dev
- name: Build ndless SDK
if: steps.sdk-cache.outputs.cache-hit != 'true'
run: make
working-directory: ndless
# actual build!
- name: Prepare sledconf
working-directory: sled
run: |
ln -s Makefiles/sledconf.ndless sledconf
- name: Build sled
working-directory: sled
run: make
env:
NDLESS_SDK: ../ndless/ndless-sdk
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: sled for ndless
path: sled/sled.tns