-
Notifications
You must be signed in to change notification settings - Fork 39
114 lines (91 loc) · 2.94 KB
/
ci.yaml
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
name: CI
on:
push:
branches: [master, staging, trying]
pull_request:
jobs:
build:
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.experimental || false }}
strategy:
matrix:
rust:
- 1.62.0
- nightly
include:
- rust: nightly
experimental: true
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy, llvm-tools-preview
target: thumbv7m-none-eabi
- name: Install Python dependencies
run: |
pip3 install --user python-dateutil linkchecker
- name: Cache installed binaries
uses: actions/cache@v1
id: cache-bin
with:
path: ~/cache-bin
key: cache-bin
- name: Install mdbook
if: steps.cache-bin.outputs.cache-hit != 'true'
uses: actions-rs/[email protected]
with:
crate: mdbook
version: latest
- name: Install cargo-binutils
if: steps.cache-bin.outputs.cache-hit != 'true'
uses: actions-rs/[email protected]
with:
crate: cargo-binutils
version: latest
- name: Install arm-none-eabi-gcc and qemu
if: steps.cache-bin.outputs.cache-hit != 'true'
run: |
mkdir -p ~/cache-bin/arm_gcc
curl -L https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.07/gcc-arm-none-eabi-10.3-2021.07-x86_64-linux.tar.bz2 \
| tar --strip-components=1 -C ~/cache-bin/arm_gcc -xj
curl -L https://github.com/japaric/qemu-bin/raw/master/14.04/qemu-system-arm-2.12.0 \
> ~/cache-bin/qemu-system-arm
chmod a+x ~/cache-bin/qemu-system-arm
- name: Copy installed binaries to cache directory
if: steps.cache-bin.outputs.cache-hit != 'true'
run: |
cp ~/.cargo/bin/* ~/cache-bin
- name: Put new bin directory into path
run: |
echo "$HOME/cache-bin" >> $GITHUB_PATH
echo "$HOME/cache-bin/arm_gcc/bin" >> $GITHUB_PATH
- name: Test
run: bash ci/script.sh
env:
RUST_VERSION: ${{ matrix.rust }}
deploy:
runs-on: ubuntu-20.04
needs: [build]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- name: Cache installed binaries
uses: actions/cache@v1
id: cache-bin
with:
path: ~/cache-bin
key: cache-bin
- name: Put new bin directory into path
run: echo "$HOME/cache-bin" >> $GITHUB_PATH
- name: Build the book
run: mdbook build
- name: Deploy book
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: book
force_orphan: true