forked from bosmoment/PineTime-apps
-
Notifications
You must be signed in to change notification settings - Fork 11
122 lines (97 loc) · 3.92 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# GitHub Actions Workflow to build Rust+RIOT Firmware for PineTime Smart Watch
# See https://lupyuen.github.io/pinetime-rust-mynewt/articles/cloud
# Name of this Workflow
name: Build PineTime Firmware
# When to run this Workflow...
on:
# Run this Workflow when files are updated (Pushed) in this Branch
push:
branches: [ master ]
# Steps to run for the Workflow
jobs:
build:
# Run these steps on Ubuntu
runs-on: ubuntu-latest
steps:
#########################################################################################
# Checkout
- name: Checkout source files
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Show files
run: set ; pwd ; ls -l
#########################################################################################
# Download and Cache Dependencies
- name: Install imgtool dependencies
run: |
pip3 install --user setuptools
pip3 install --user pycrypto ecdsa pyasn1
# - name: Fetch cache for Rust Toolchain
# id: cache-rust
# uses: actions/cache@v2
# with:
# path: |
# ~/.cargo/registry
# ~/.cargo/git
# target
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust Target thumbv7em-none-eabihf
run: |
rustup default nightly
rustup target add thumbv7em-none-eabihf
- name: Check cache for Embedded Arm Toolchain arm-none-eabi-gcc
id: cache-toolchain
uses: actions/cache@v2
env:
cache-name: cache-toolchain
with:
path: ${{ runner.temp }}/arm-none-eabi
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install Embedded Arm Toolchain arm-none-eabi-gcc
if: steps.cache-toolchain.outputs.cache-hit != 'true' # Install toolchain if not found in cache
uses: fiam/arm-none-eabi-gcc@v1.0.2
with:
# GNU Embedded Toolchain for Arm release name, in the V-YYYY-qZ format (e.g. "9-2019-q4")
release: 8-2019-q3
# Directory to unpack GCC to. Defaults to a temporary directory.
directory: ${{ runner.temp }}/arm-none-eabi
#########################################################################################
# Build and Upload Standalone Rust+RIOT Application Firmware
- name: Build Standalone Application Firmware
run: |
export PATH=$PATH:${{ runner.temp }}/arm-none-eabi/bin
./scripts/build-app.sh
- name: Upload Standalone Application Firmware
uses: actions/upload-artifact@v2
with:
name: PineTime.elf
path: apps/pinetime/bin/pinetime/PineTime.elf
- name: Upload Standalone Application Firmware Outputs
uses: actions/upload-artifact@v2
with:
name: PineTime.zip
path: apps/pinetime/bin/pinetime/PineTime.*
#########################################################################################
# Build and Upload Rust+RIOT Application Firmware for MCUBoot
- name: Build Application Firmware for MCUBoot
run: |
export PATH=$PATH:${{ runner.temp }}/arm-none-eabi/bin
export IMAGE_VERSION=1.1.1+1
cd apps/pinetime
make mcuboot
- name: Upload Application Firmware for MCUBoot
uses: actions/upload-artifact@v2
with:
name: PineTime-mcuboot.elf
path: apps/pinetime/bin/pinetime/PineTime.elf
- name: Upload Application Firmware Outputs for MCUBoot
uses: actions/upload-artifact@v2
with:
name: PineTime-mcuboot.zip
path: apps/pinetime/bin/pinetime/PineTime.*
#########################################################################################
# Finish
# Embedded Arm Toolchain will only be cached if the build succeeds.
# So make sure that the first build always succeeds, e.g. comment out the "Build" step.