This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
217 lines (214 loc) · 9.18 KB
/
action-build-all-i386.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
name: 'CI i386: Full testing cycle'
on:
push:
branches: [master]
pull_request:
branches: [master]
release:
types: [created]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
VERSION: unknown
RTEMS_ARCH: i386
RTEMS_BSP: pc386
BUILD_OR_IMPORT: Build
jobs:
build-all-components:
name: 'CI i386: Build cross-tools, RTEMS and application'
runs-on: ubuntu-latest
steps:
- name: 'Step 1: Clone the project repo'
uses: actions/[email protected]
with:
submodules: true
fetch-depth: 0
- name: 'Step 2: Install all packages'
run: |
sudo apt-get update
sudo apt-get install -yy build-essential gcc g++ gdb git pax bison flex texinfo unzip
sudo apt-get install -yy python3-dev libncurses5-dev zlib1g-dev python-dev curl locales wget
sudo apt-get clean all
- name: 'Step 3: Generating locales'
run: sudo localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
- name: 'Step 4: Make preparations'
run: |
./preparations.sh
osversion=$(bash ./ci/ci-generate-version.sh rtems --arch ${{ env.RTEMS_ARCH }} --bsp ${{ env.RTEMS_BSP }})
echo ${osversion}
echo "::set-env name=VERSION::$osversion"
tarball_path=$(bash ci/ci-import-rtems-tarball.sh --arch ${{ env.RTEMS_ARCH }} --bsp ${{ env.RTEMS_BSP }})
[[ "${tarball_path}" == "does-not-exist" ]] \
|| tar -xvf ${tarball_path} -C rtems_rtos; action_type='Import'; echo "::set-env name=BUILD_OR_IMPORT::$action_type"
- name: 'Step 5: ${{ env.BUILD_OR_IMPORT }} cross-tools ${{ env.RTEMS_ARCH }}/${{ env.RTEMS_BSP }}'
run: |
tarball_path=$(bash ci/ci-import-rtems-tarball.sh --arch ${{ env.RTEMS_ARCH }} --bsp ${{ env.RTEMS_BSP }})
action_type=${{ env.BUILD_OR_IMPORT }}
[[ "${action_type}" == "Build" ]] && ./build.sh cross || echo "GCC Cross Compiler files have been imported"
- name: 'Step 6: ${{ env.BUILD_OR_IMPORT }} RTEMS ${{ env.VERSION }}'
run: |
action_type=${{ env.BUILD_OR_IMPORT }}
[[ "${action_type}" == "Build" ]] && ./build.sh rtems || echo "RTEMS object files have been imported"
current_branch=${{ github.head_ref }}
[[ -z $current_branch ]] || branch_param="--branch $current_branch"
pversion=$(bash ./ci/ci-generate-version.sh --arch ${{ env.RTEMS_ARCH }} --bsp ${{ env.RTEMS_BSP }} $branch_param)
echo ${pversion}
echo "::set-env name=VERSION::$pversion"
- name: 'Step 7: Build application. Version : ${{ env.VERSION }}'
run: ./build.sh
- name: 'Step 8: Upload artifact: ${{ env.VERSION }}-exe-artifact'
uses: actions/upload-artifact@v2
with:
name: '${{ env.VERSION }}-exe-artifact'
path: ./*.exe
creating-qemu-image:
needs: build-all-components
name: 'CI i386: Create the QEMU bootable disk image with RTEMS'
runs-on: ubuntu-latest
steps:
- name: 'Step 1: Repo'
uses: actions/[email protected]
with:
submodules: true
fetch-depth: 0
- name: 'Step 2: Make preparations'
run: |
./preparations.sh
current_branch=${{ github.head_ref }}
[[ -z $current_branch ]] || branch_param="--branch $current_branch"
pversion=$(bash ./ci/ci-generate-version.sh --arch ${{ env.RTEMS_ARCH }} --bsp ${{ env.RTEMS_BSP }} $branch_param)
echo ${pversion}
echo "::set-env name=VERSION::$pversion"
- name: 'Step 3: Download artifact: ${{ env.VERSION }}-exe-artifact'
uses: actions/download-artifact@v2
with:
name: '${{ env.VERSION }}-exe-artifact'
- name: 'Step 4: Creating a new bootable image'
run: |
dd if=/dev/zero of=boot-disk.img bs=512 count=32130
sudo ./ci/ci-create-boot-image.sh --file boot-disk.img
- name: 'Step 5: Upload artifact: ${{ env.VERSION }}-boot-disk-img-artifact'
uses: actions/upload-artifact@v2
with:
name: '${{ env.VERSION }}-boot-disk-img-artifact'
path: boot-disk.img
test-exe-on-qemu:
needs: build-all-components
name: 'CI i386: Run exe on QEMU'
runs-on: ubuntu-latest
continue-on-error: false
steps:
- name: 'Step 1: Checkout Repo'
uses: actions/[email protected]
with:
submodules: true
fetch-depth: 0
- name: 'Step 2: Make preparations'
run: |
./preparations.sh
current_branch=${{ github.head_ref }}
[[ -z $current_branch ]] || branch_param="--branch $current_branch"
pversion=$(bash ./ci/ci-generate-version.sh --arch ${{ env.RTEMS_ARCH }} --bsp ${{ env.RTEMS_BSP }} $branch_param)
echo ${pversion}
echo "::set-env name=VERSION::$pversion"
- name: 'Step 3: Install QEMU'
run: |
sudo apt-get update
sudo apt-get install -yy qemu-system-i386
- name: 'Step 4: Download artifact: ${{ env.VERSION }}-exe-artifact'
uses: actions/download-artifact@v2
with:
name: '${{ env.VERSION }}-exe-artifact'
- name: 'Step 5: Test exe on QEMU'
run: timeout 5 ./ci/ci-test-exe-on-qemu.sh || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
test-image-on-qemu:
needs: creating-qemu-image
name: 'CI i386: Check virtual disk image'
runs-on: ubuntu-latest
continue-on-error: false
steps:
- name: 'Step 1: Checkout Repo'
uses: actions/[email protected]
with:
submodules: true
fetch-depth: 0
- name: 'Step 2: Make preparations'
run: |
./preparations.sh
current_branch=${{ github.head_ref }}
[[ -z $current_branch ]] || branch_param="--branch $current_branch"
pversion=$(bash ./ci/ci-generate-version.sh --arch ${{ env.RTEMS_ARCH }} --bsp ${{ env.RTEMS_BSP }} $branch_param)
echo ${pversion}
echo "::set-env name=VERSION::$pversion"
- name: 'Step 3: Install QEMU'
run: |
sudo apt-get update
sudo apt-get install -yy qemu-system-i386
- name: 'Step 4: Download artifact: ${{ env.VERSION }}-boot-disk-img-artifact'
uses: actions/download-artifact@v2
with:
name: '${{ env.VERSION }}-boot-disk-img-artifact'
- name: 'Step 5: Test disk image on QEMU'
run: timeout 10 ./ci/ci-test-image-on-qemu.sh || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
build-coreboot:
name: 'CI i386: Build coreboot'
runs-on: ubuntu-latest
steps:
- name: 'Step 1: Checkout Repo'
uses: actions/[email protected]
with:
submodules: true
fetch-depth: 0
- name: 'Step 2: Install packages for building'
run: |
sudo apt-get update
sudo apt-get install git build-essential gnat flex bison libncurses5-dev wget zlib1g-dev unzip
- name: 'Step 3: Build/Import coreboot image'
run: |
coreboot_artifact_path=$(bash ./ci/ci-import-coreboot-artifact.sh)
[[ "${coreboot_artifact_path}" == "does-not-exist" ]] && ./ci/ci-coreboot-build-image.sh || unzip ${coreboot_artifact_path}
cversion=$(basename *.rom -x86-p35-coreboot.rom)
echo ${cversion}
echo "::set-env name=VERSION::$cversion"
- name: 'Step 4: Upload artifact: ${{ env.VERSION }}-x86-p35-coreboot-artifact'
uses: actions/upload-artifact@v2
with:
name: 'x86-p35-coreboot-test-artifact'
path: ${{ env.VERSION }}-x86-p35-coreboot.rom
test-image-with-coreboot-on-qemu:
needs: [build-coreboot, creating-qemu-image]
name: 'CI i386: Run coreboot with RTEMS disk image on QEMU'
runs-on: ubuntu-latest
continue-on-error: false
steps:
- name: 'Step 1: Checkout Repo'
uses: actions/[email protected]
with:
submodules: true
fetch-depth: 0
- name: 'Step 2: Make preparations'
run: |
./preparations.sh
current_branch=${{ github.head_ref }}
[[ -z $current_branch ]] || branch_param="--branch $current_branch"
pversion=$(bash ./ci/ci-generate-version.sh --arch ${{ env.RTEMS_ARCH }} --bsp ${{ env.RTEMS_BSP }} $branch_param)
echo ${pversion}
echo "::set-env name=VERSION::$pversion"
- name: 'Step 3: Install QEMU'
run: |
sudo apt-get update
sudo apt-get install -yy qemu-system-i386
- name: 'Step 4: Download artifact: ${{ env.VERSION }}-boot-disk-img-artifact'
uses: actions/download-artifact@v2
with:
name: '${{ env.VERSION }}-boot-disk-img-artifact'
- name: 'Step 5: Download x86-p35-coreboot-test-artifact'
uses: actions/download-artifact@v2
with:
name: 'x86-p35-coreboot-test-artifact'
- name: 'Step 6: Get coreboot version'
run: |
cversion=$(basename *.rom -x86-p35-coreboot.rom)
echo ${cversion}
echo "::set-env name=VERSION::$pversion"
- name: 'Step 7: Run on QEMU: coreboot ${{ env.VERSION }}'
run: timeout 10 ./ci/ci-test-image-with-coreboot-on-qemu.sh || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi