forked from kailun-qin/rust-td
-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (67 loc) · 2.15 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
on:
push:
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
workflow_dispatch:
name: RUN CODE
env:
RUST_TOOLCHAIN: nightly-2021-08-20
TOOLCHAIN_PROFILE: minimal
jobs:
system_complie:
name: complie
runs-on: ${{ matrix.host_os }}
strategy:
matrix:
host_os:
- ubuntu-latest
- windows-latest
steps:
- name: install NASM
uses: ilammy/setup-nasm@v1
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "10.0"
directory: ${{ runner.temp }}/llvm
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: rust-src
- name: Cache
uses: Swatinem/rust-cache@v1
- name: Run cargo install cargo-xbuild
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-xbuild
- name: Build TdShim
uses: actions-rs/cargo@v1
env:
CC: clang
AR: llvm-ar
with:
command: xbuild
args: -p rust-tdshim --target x86_64-unknown-uefi --release
- name: cargo tests
run: cargo test
- name: Build PE format payload
run: |
pushd rust-td-payload
cargo xbuild --target x86_64-unknown-uefi --release
popd
cargo run -p rust-td-tool -- target/x86_64-unknown-uefi/release/ResetVector.bin target/x86_64-unknown-uefi/release/rust-tdshim.efi target/x86_64-unknown-uefi/release/rust-td-payload.efi target/x86_64-unknown-uefi/release/final.bin
- name: Build Elf format payload
run: |
pushd rust-td-payload
cargo xbuild --target target.json --release
popd
cargo run -p rust-td-tool -- target/x86_64-unknown-uefi/release/ResetVector.bin target/x86_64-unknown-uefi/release/rust-tdshim.efi target/target//release/rust-td-payload target/x86_64-unknown-uefi/release/final.bin