forked from seL4/microkit
-
Notifications
You must be signed in to change notification settings - Fork 11
164 lines (162 loc) · 7.94 KB
/
ci.yaml
File metadata and controls
164 lines (162 loc) · 7.94 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: CI
on:
# Run the CI on any activity on the main or dev branch as well as on any pull
# request activity (e.g when it is created and also when it is updated).
pull_request:
push:
branches: [ "main", "dev", "workshop" ]
# @ivanv: The primary issue with the following CI is that it does not control
# the dependencies of the system enough. We are at the mercy of the GitHub VMs
# to not break the dependencies by updating a version of something etc.
# Ideally we would instead install specific versions of everything, or build
# everything from specified source code commits.
jobs:
build_linux:
name: Build and upload SDK (Linux x86-64)
runs-on: ubuntu-20.04
steps:
- name: Checkout seL4 Core Platform repository
uses: actions/checkout@v3
- name: Checkout seL4 repository
uses: actions/checkout@v3
with:
repository: Ivan-Velickovic/seL4
ref: microkit-dev
path: seL4
- name: Install SDK dependencies (apt)
run: |
sudo apt update
sudo apt install \
cmake pandoc device-tree-compiler ninja-build \
texlive-fonts-recommended texlive-formats-extra libxml2-utils \
gcc-aarch64-linux-gnu python3.9 python3-pip python3.9-venv \
musl-tools
- name: Install Nix
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
# Unfortunately `apt` decides to ship really old versions of QEMU,
# too old for our purposes as seL4 requires a newer version of QEMU.
# The CI is too slow to build QEMU from source, so we just install
# Nix instead.
- name: Install SDK dependencies (Nix)
run: nix-env -i qemu -f '<nixpkgs>'
- name: Download and install AArch64 GCC toolchain
run: |
wget -O aarch64-toolchain.tar.gz https://sel4.ivanvelickovic.com/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-elf.tar.xz%3Frev%3D73ff9780c12348b1b6772a1f54ab4bb3
tar xf aarch64-toolchain.tar.gz
echo "$(pwd)/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-elf/bin" >> $GITHUB_PATH
- name: Check SHA256 of AArch64 GCC toolchain
run: |
echo "fb9e562a90de1b3a2961b952193c1c6520872aa1482c0a5e0ab79970ec6e7690 aarch64-toolchain.tar.gz" | sha256sum -c
- name: Download and install RISC-V GCC toolchain
run: |
wget -O riscv-toolchain.tar.gz https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz
tar xf riscv-toolchain.tar.gz
echo "$(pwd)/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin" >> $GITHUB_PATH
- name: Build SDK
run: |
python3.9 -m venv pyenv
./pyenv/bin/pip install --upgrade pip setuptools wheel
./pyenv/bin/pip install -r requirements.txt --no-cache-dir
./pyenv/bin/python build_sdk.py --sel4=seL4
- name: Test SDK
run: ./pyenv/bin/python ./ci/test.py
- name: Get shortened commit SHA
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Archive SDK
uses: actions/upload-artifact@v3
with:
name: microkit-sdk-${{ github.ref_name }}-${{ steps.vars.outputs.sha_short }}-linux-x86-64
path: ./release/microkit-sdk-1.2.6.tar.gz
build_macos_x86_64:
name: Build and upload SDK (macOS x86-64)
runs-on: macos-12
steps:
- name: Checkout seL4 Core Platform repository
uses: actions/checkout@v3
- name: Checkout seL4 repository
uses: actions/checkout@v3
with:
repository: Ivan-Velickovic/seL4
ref: microkit-dev
path: seL4
- name: Install SDK dependencies
run: |
brew tap messense/macos-cross-toolchains
brew install pandoc cmake dtc ninja qemu libxml2 python@3.9 coreutils aarch64-unknown-linux-gnu texlive
- name: Download and install AArch64 GCC toolchain
run: |
wget -O aarch64-toolchain.tar.gz https://sel4.ivanvelickovic.com/arm-gnu-toolchain-11.3.rel1-darwin-x86_64-aarch64-none-elf.tar.xz%3Frev%3D51c39c753f8c4a54875b7c5dccfb84ef
tar xf aarch64-toolchain.tar.gz
echo "$(pwd)/arm-gnu-toolchain-11.3.rel1-darwin-x86_64-aarch64-none-elf/bin" >> $GITHUB_PATH
- name: Check SHA256 of AArch64 GCC toolchain
run: |
echo "cb8ee50df1d54135dc0e57a1787eda8c090fa5561aaa20fcbcc0548dfb8dceb2 aarch64-toolchain.tar.gz" | sha256sum -c
- name: Download and install RISC-V GCC toolchain
run: |
wget -O riscv-toolchain.tar.gz https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-apple-darwin.tar.gz
tar xf riscv-toolchain.tar.gz
echo "$(pwd)/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-apple-darwin/bin" >> $GITHUB_PATH
- name: Build SDK
run: |
python3.9 -m venv pyenv
./pyenv/bin/pip install --upgrade pip setuptools wheel
./pyenv/bin/pip install -r requirements.txt --no-cache-dir
./pyenv/bin/python build_sdk.py --sel4=seL4
- name: Test SDK
run: ./pyenv/bin/python ./ci/test.py
- name: Get shortened commit SHA
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Archive SDK
uses: actions/upload-artifact@v3
with:
name: microkit-sdk-${{ github.ref_name }}-${{ steps.vars.outputs.sha_short }}-macos-x86-64
path: ./release/microkit-sdk-1.2.6.tar.gz
build_macos_aarch64:
name: Build and upload SDK (macOS AArch64)
runs-on: macos-12
steps:
- name: Checkout seL4 Core Platform repository
uses: actions/checkout@v3
- name: Checkout seL4 repository
uses: actions/checkout@v3
with:
repository: Ivan-Velickovic/seL4
ref: microkit-dev
path: seL4
- name: Install SDK dependencies
run: |
brew tap messense/macos-cross-toolchains
brew install pandoc cmake dtc ninja qemu libxml2 python@3.9 coreutils aarch64-unknown-linux-gnu texlive
- name: Download and install AArch64 GCC toolchain
run: |
wget -O aarch64-toolchain.tar.gz https://sel4.ivanvelickovic.com/arm-gnu-toolchain-11.3.rel1-darwin-x86_64-aarch64-none-elf.tar.xz%3Frev%3D51c39c753f8c4a54875b7c5dccfb84ef
tar xf aarch64-toolchain.tar.gz
echo "$(pwd)/arm-gnu-toolchain-11.3.rel1-darwin-x86_64-aarch64-none-elf/bin" >> $GITHUB_PATH
- name: Check SHA256 of AArch64 GCC toolchain
run: |
echo "cb8ee50df1d54135dc0e57a1787eda8c090fa5561aaa20fcbcc0548dfb8dceb2 aarch64-toolchain.tar.gz" | sha256sum -c
- name: Download and install RISC-V GCC toolchain
run: |
wget -O riscv-toolchain.tar.gz https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-apple-darwin.tar.gz
tar xf riscv-toolchain.tar.gz
echo "$(pwd)/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-apple-darwin/bin" >> $GITHUB_PATH
- name: Build SDK
run: |
python3.9 -m venv pyenv
./pyenv/bin/pip install --upgrade pip setuptools wheel
./pyenv/bin/pip install -r requirements.txt --no-cache-dir
./pyenv/bin/python build_sdk.py --sel4=seL4 --tool-target-triple=aarch64-apple-darwin
# Since we're cross compiling the tool and not actually running on AArch64, we can't test
# the tool like we usually would
- name: Get shortened commit SHA
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Archive SDK
uses: actions/upload-artifact@v3
with:
name: microkit-sdk-${{ github.ref_name }}-${{ steps.vars.outputs.sha_short }}-macos-aarch64
path: ./release/microkit-sdk-1.2.6.tar.gz