-
Notifications
You must be signed in to change notification settings - Fork 24
170 lines (158 loc) · 5.92 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
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
165
166
167
168
169
170
name: Build
on:
pull_request:
push:
branches:
- main
- release-**
workflow_dispatch:
workflow_call:
env:
CARGO_TERM_COLOR: always
concurrency:
group: "build-${{ github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
build_and_system_tests_linux_amd64:
name: Build and run system tests Linux amd64
runs-on: ubuntu-latest
container:
image: ghcr.io/eclipse-ankaios/devcontainer-base:0.10.2
options: --privileged
steps:
- uses: actions/checkout@v4.1.1
- name: Build debug
run: cargo build
- name: Prepare system tests
run: |
mkdir -p target/robot_tests_result
chown vscode target/robot_tests_result
- name: Run system tests in pull request verification
if: ${{ github.event_name == 'pull_request' }}
run: |
SYSTEM_TEST_EXCLUDE_TAG="non_execution_during_pull_request_verification"
echo "Run is a PR verification, system tests tagged with '$SYSTEM_TEST_EXCLUDE_TAG' are NOT executed and skipped."
su vscode -c "tools/run_robot_tests.sh --exclude $SYSTEM_TEST_EXCLUDE_TAG tests"
- name: Run all system tests
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "Event name is '${{ github.event_name }}', all system tests are executed."
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
unit_tests_and_code_checks_linux_amd64:
name: Run unit tests Linux amd64
runs-on: ubuntu-latest
container:
image: ghcr.io/eclipse-ankaios/devcontainer-base:0.10.2
options: --privileged
steps:
- uses: actions/checkout@v4.1.1
- name: Run unit tests
run: RUST_LOG=debug cargo nextest run
- name: Run clippy code checks
run: just clippy
- name: Prevent docker.io images in test
run: just check-test-images
- name: Check copyright headers
run: just check-copyright-headers
# 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: just 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
code_coverage_linux_amd64:
name: Create code coverage report
runs-on: ubuntu-latest
container:
image: ghcr.io/eclipse-ankaios/devcontainer-base:0.10.2
options: --privileged
steps:
- uses: actions/checkout@v4.1.1
- name: Create code coverage html report
run: |
rustup component add llvm-tools-preview
just coverage
- uses: actions/upload-artifact@v4.3.3
with:
name: code-coverage
path: target/llvm-cov/html
build_linux_amd64_debian_package:
name: Build Linux amd64 debian package
runs-on: ubuntu-latest
container:
image: ghcr.io/eclipse-ankaios/devcontainer-base:0.10.2
options: --privileged
steps:
- uses: actions/checkout@v4.1.1
- 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 debian package
runs-on: ubuntu-latest
container:
image: ghcr.io/eclipse-ankaios/devcontainer-base:0.10.2
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.10.2
options: --user root
steps:
- uses: actions/checkout@v4.1.1
- run: |
just trace-requirements dist/req_tracing_report.html
- uses: actions/upload-artifact@v4.3.3
with:
name: requirement-tracing-report
path: dist/