-
Notifications
You must be signed in to change notification settings - Fork 15
132 lines (118 loc) · 4.43 KB
/
build.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
123
124
125
126
127
128
129
130
131
132
name: Build
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
workflow_call:
env:
CARGO_TERM_COLOR: always
concurrency:
group: "build-${{ github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
test_and_build_linux_amd64:
name: Test and build Linux amd64
runs-on: ubuntu-latest
container:
image: ghcr.io/eclipse-ankaios/devcontainer-base:0.9.1
options: --privileged
steps:
- uses: actions/checkout@v4.1.1
- uses: Swatinem/rust-cache@v2.6.2
# If the next step fails, then a license used by a new dependency is currently
# not part of the whitelist in deny.toml. If the new license fits to the project
# then it should be added to the whitelist otherwise the dependency needs to be
# removed.
- name: Check licenses
run: cargo deny check licenses
- name: Create license report
run: |
mkdir -p build
cargo about generate about.hbs > build/licenses.html
- uses: actions/upload-artifact@v4.3.3
with:
name: licenses
path: build/licenses.html
- name: Run tests
run: RUST_LOG=debug cargo nextest run
- name: Run robot tests
run: |
cargo build
mkdir -p target/robot_tests_result
chown vscode target/robot_tests_result
su vscode -c "tools/run_robot_tests.sh tests"
- uses: actions/upload-artifact@v4.3.3
if: success() || failure()
with:
name: robot-tests-result
path: target/robot_tests_result
- name: Create code coverage report
run: |
rustup component add llvm-tools-preview
tools/generate_test_coverage_report.sh test --html
- uses: actions/upload-artifact@v4.3.3
with:
name: code-coverage
path: target/llvm-cov/html
- name: Build linux-amd64 release-mode
run: |
cargo build --release
mkdir -p dist/
cp target/x86_64-unknown-linux-musl/release/ank target/x86_64-unknown-linux-musl/release/ank-server target/x86_64-unknown-linux-musl/release/ank-agent dist/
- uses: actions/upload-artifact@v4.3.3
with:
name: ankaios-linux-amd64-bin
path: dist/
- name: Build linux-amd64 debian package
run: |
cargo deb -p ank --target x86_64-unknown-linux-musl
- uses: actions/upload-artifact@v4.3.3
with:
name: ankaios-linux-amd64-deb
path: target/x86_64-unknown-linux-musl/debian/ankaios*.deb
build_linux_arm64:
# currently there is no arm64 github built-in runner available
# however, there is an issue in progress on the github runner repo
# requesting the support for arm64: https://github.com/actions/runner-images/issues/5631
# if arm64 variants will be released we can switch to an arm64 image and save the longer built time for cross platform build
# and in addition, tests for arm64 can be enabled in this job, too
name: Build Linux arm64
runs-on: ubuntu-latest
container:
image: ghcr.io/eclipse-ankaios/devcontainer-base:0.9.1
options: --user root
steps:
- uses: actions/checkout@v4.1.1
- name: Build linux-arm64 release-mode
run: |
cargo build --target aarch64-unknown-linux-musl --release
mkdir -p dist/
cp target/aarch64-unknown-linux-musl/release/ank target/aarch64-unknown-linux-musl/release/ank-server target/aarch64-unknown-linux-musl/release/ank-agent dist/
- uses: actions/upload-artifact@v4.3.3
with:
name: ankaios-linux-arm64-bin
path: dist/
- name: Build linux-arm64 debian package
run: |
cargo deb -p ank --target aarch64-unknown-linux-musl
- uses: actions/upload-artifact@v4.3.3
with:
name: ankaios-linux-arm64-deb
path: target/aarch64-unknown-linux-musl/debian/ankaios*.deb
requirements:
name: Build requirements tracing
runs-on: ubuntu-latest
container:
image: ghcr.io/eclipse-ankaios/devcontainer-base:0.9.1
options: --user root
steps:
- uses: actions/checkout@v4.1.1
- run: |
mkdir -p dist
oft trace $(find . -type d -name "src" -o -name "doc") -a swdd,utest,itest,stest,impl -o html -f dist/req_tracing_report.html || true
- uses: actions/upload-artifact@v4.3.3
with:
name: requirement-tracing-report
path: dist/