-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (157 loc) · 5.6 KB
/
main.yml
File metadata and controls
159 lines (157 loc) · 5.6 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
name: CI
on: [push, pull_request]
jobs:
build_tools_linux:
name: Build tools for Linux
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- name: Cache tools
id: cache
uses: actions/cache@v3
env:
cache-name: cache-tools
with:
path: tools
key: linux-${{ env.cache-name }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('tools/src') }}
- name: Install build requirements
if: steps.cache.outputs.cache-hit != 'true'
run: sudo apt install wget build-essential file
- name: Build i686-elf-tools
if: steps.cache.outputs.cache-hit != 'true'
run: tools/src/build-i686-elf-tools.sh
shell: sh
- name: Cleanup after i686-elf-tools build
if: steps.cache.outputs.cache-hit != 'true'
run: rm -rf tools/src/binutils-* tools/src/gcc-*
- name: Build GenFw
if: steps.cache.outputs.cache-hit != 'true'
run: tools/src/GenFw/build.sh
shell: sh
- name: Build imgtools
if: steps.cache.outputs.cache-hit != 'true'
run: tools/src/imgtools/build.sh
shell: sh
- name: Build mkdosfs
if: steps.cache.outputs.cache-hit != 'true'
run: tools/src/mkdosfs/build.sh
shell: sh
- name: Tar tools
run: tar -cf chaostools-linux.tar --exclude='src' -C tools .
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: chaostools-linux.tar
path: chaostools-linux.tar
build_tools_windows:
name: Build tools for Windows
needs: [build_tools_linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache tools
id: cache
uses: actions/cache@v3
env:
cache-name: cache-tools
with:
path: tools
key: windows-${{ env.cache-name }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('tools/src') }}
- name: Install build requirements
if: steps.cache.outputs.cache-hit != 'true'
run: sudo apt install wget build-essential file git automake autopoint bison flex libgdk-pixbuf2.0-dev gperf intltool libtool libltdl-dev python3-mako ruby unzip p7zip-full lzip libtool-bin python-is-python3 gcc-mingw-w64-x86-64
- name: Download linux tools artifact
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/download-artifact@v3
with:
name: chaostools-linux.tar
- name: Untar tools
if: steps.cache.outputs.cache-hit != 'true'
run: tar -xvf chaostools-linux.tar -C tools
- name: Build i686-elf-tools
if: steps.cache.outputs.cache-hit != 'true'
run: tools/src/build-i686-elf-tools-win.sh
shell: sh
- name: Cleanup after i686-elf-tools build
if: steps.cache.outputs.cache-hit != 'true'
run: rm -rf tools/src/mxe tools/src/binutils-* tools/src/gcc-*
- name: Build GenFw
if: steps.cache.outputs.cache-hit != 'true'
run: tools/src/GenFw/build-win.sh
shell: sh
- name: Build imgtools
if: steps.cache.outputs.cache-hit != 'true'
run: tools/src/imgtools/build-win.sh
shell: sh
- name: Build mkdosfs
if: steps.cache.outputs.cache-hit != 'true'
run: tools/src/mkdosfs/build-win.sh
shell: sh
- name: Remove linux tools
if: steps.cache.outputs.cache-hit != 'true'
run: tar -tf chaostools-linux.tar | tail -n +2 | sed -e 's!^!tools/!' | xargs rm -rf
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: chaostools-windows
path: |
tools
!tools/src
build_linux:
name: Build on Linux
needs: [build_tools_linux]
strategy:
matrix:
type: ["floppy", "hd", "hd --mbr"]
debug: ["", "--debug"]
test: ["", "--test"]
efi: ["", "--efi"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install tools
run: sudo apt install nasm make qemu-utils python3
- name: Download additional tools artifact
uses: actions/download-artifact@v3
with:
name: chaostools-linux.tar
- name: Untar tools
if: steps.cache.outputs.cache-hit != 'true'
run: tar -xvf chaostools-linux.tar -C tools
- name: Run the build script
run: ./build_image.sh ${{ matrix.type }} ${{ matrix.debug }} ${{ matrix.test }} ${{ matrix.efi }} --user-programs-all
shell: sh
build_windows:
name: Build on Windows
needs: [build_tools_windows]
strategy:
matrix:
type: ["floppy", "hd", "hd --mbr"]
debug: ["", "--debug"]
test: ["", "--test"]
efi: ["", "--efi"]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install nasm
uses: ilammy/setup-nasm@v1
- name: Install Python3
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install winget
uses: Cyberboss/install-winget@v1
- name: Install QEMU
run: winget install --accept-source-agreements --accept-package-agreements --id=SoftwareFreedomConservancy.QEMU -e
- name: Add QEMU to the PATH
shell: pwsh
run: |
"C:\Program Files\qemu" >> $env:GITHUB_PATH
- name: Download tools artifact
uses: actions/download-artifact@v3
with:
name: chaostools-windows
path: tools
- name: Run the build script
run: BUILD_IMAGE.BAT ${{ matrix.type }} ${{ matrix.debug }} ${{ matrix.test }} ${{ matrix.efi }} --user-programs-all
shell: cmd