@@ -3,64 +3,157 @@ name: CI
33on : [push, pull_request]
44
55jobs :
6- download_tools :
7- name : Download tools
8- strategy :
9- matrix :
10- os : ["ubuntu-latest", "windows-latest"]
11- runs-on : ${{ matrix.os }}
6+ build_tools_linux :
7+ name : Build tools for Linux
8+ runs-on : " ubuntu-latest"
129 steps :
13- - uses : actions/checkout@v2
10+ - uses : actions/checkout@v3
1411 - name : Cache tools
1512 id : cache
16- uses : actions/cache@v2
13+ uses : actions/cache@v3
1714 env :
1815 cache-name : cache-tools
1916 with :
2017 path : tools
21- key : ${{ runner.os }}-${{ env.cache-name }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('download_tools.sh', 'DOWNLOAD_TOOLS.BAT') }}
22- - name : Download tools (Linux)
23- if : runner.os == 'Linux' && steps.cache.outputs.cache-hit != 'true'
24- run : ./download_tools.sh
18+ key : linux-${{ env.cache-name }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('tools/src') }}
19+ - name : Install build requirements
20+ if : steps.cache.outputs.cache-hit != 'true'
21+ run : sudo apt install wget build-essential file
22+ - name : Build i686-elf-tools
23+ if : steps.cache.outputs.cache-hit != 'true'
24+ run : tools/src/build-i686-elf-tools.sh
2525 shell : sh
26- - name : Download tools (Windows)
27- if : runner.os == 'Windows' && steps.cache.outputs.cache-hit != 'true'
28- run : DOWNLOAD_TOOLS.BAT
29- shell : cmd
30- build :
31- name : Build
32- needs : [download_tools]
33- strategy :
34- matrix :
35- os : ["ubuntu-latest", "windows-latest"]
36- type : ["floppy", "hd", "hd --mbr"]
37- debug : ["", "--debug"]
38- test : ["", "--test"]
39- efi : ["", "--efi"]
40- runs-on : ${{ matrix.os }}
26+ - name : Cleanup after i686-elf-tools build
27+ if : steps.cache.outputs.cache-hit != 'true'
28+ run : rm -rf tools/src/binutils-* tools/src/gcc-*
29+ - name : Build GenFw
30+ if : steps.cache.outputs.cache-hit != 'true'
31+ run : tools/src/GenFw/build.sh
32+ shell : sh
33+ - name : Build imgtools
34+ if : steps.cache.outputs.cache-hit != 'true'
35+ run : tools/src/imgtools/build.sh
36+ shell : sh
37+ - name : Build mkdosfs
38+ if : steps.cache.outputs.cache-hit != 'true'
39+ run : tools/src/mkdosfs/build.sh
40+ shell : sh
41+ - name : Tar tools
42+ run : tar -cf chaostools-linux.tar --exclude='src' -C tools .
43+ - name : Archive artifacts
44+ uses : actions/upload-artifact@v3
45+ with :
46+ name : chaostools-linux.tar
47+ path : chaostools-linux.tar
48+ build_tools_windows :
49+ name : Build tools for Windows
50+ needs : [build_tools_linux]
51+ runs-on : ubuntu-latest
4152 steps :
42- - uses : actions/checkout@v2
53+ - uses : actions/checkout@v3
4354 - name : Cache tools
4455 id : cache
45- uses : actions/cache@v2
56+ uses : actions/cache@v3
4657 env :
4758 cache-name : cache-tools
4859 with :
4960 path : tools
50- key : ${{ runner.os }}-${{ env.cache-name }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('download_tools.sh', 'DOWNLOAD_TOOLS.BAT') }}
51- - name : Download tools (Linux)
52- if : runner.os == 'Linux' && steps.cache.outputs.cache-hit != 'true'
53- run : ./download_tools.sh
61+ key : windows-${{ env.cache-name }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('tools/src') }}
62+ - name : Install build requirements
63+ if : steps.cache.outputs.cache-hit != 'true'
64+ 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
65+ - name : Download linux tools artifact
66+ if : steps.cache.outputs.cache-hit != 'true'
67+ uses : actions/download-artifact@v3
68+ with :
69+ name : chaostools-linux.tar
70+ - name : Untar tools
71+ if : steps.cache.outputs.cache-hit != 'true'
72+ run : tar -xvf chaostools-linux.tar -C tools
73+ - name : Build i686-elf-tools
74+ if : steps.cache.outputs.cache-hit != 'true'
75+ run : tools/src/build-i686-elf-tools-win.sh
5476 shell : sh
55- - name : Download tools (Windows)
56- if : runner.os == 'Windows' && steps.cache.outputs.cache-hit != 'true'
57- run : DOWNLOAD_TOOLS.BAT
58- shell : cmd
59- - name : Run the build script (Linux)
60- if : runner.os == 'Linux'
77+ - name : Cleanup after i686-elf-tools build
78+ if : steps.cache.outputs.cache-hit != 'true'
79+ run : rm -rf tools/src/mxe tools/src/binutils-* tools/src/gcc-*
80+ - name : Build GenFw
81+ if : steps.cache.outputs.cache-hit != 'true'
82+ run : tools/src/GenFw/build-win.sh
83+ shell : sh
84+ - name : Build imgtools
85+ if : steps.cache.outputs.cache-hit != 'true'
86+ run : tools/src/imgtools/build-win.sh
87+ shell : sh
88+ - name : Build mkdosfs
89+ if : steps.cache.outputs.cache-hit != 'true'
90+ run : tools/src/mkdosfs/build-win.sh
91+ shell : sh
92+ - name : Remove linux tools
93+ if : steps.cache.outputs.cache-hit != 'true'
94+ run : tar -tf chaostools-linux.tar | tail -n +2 | sed -e 's!^!tools/!' | xargs rm -rf
95+ - name : Archive artifacts
96+ uses : actions/upload-artifact@v3
97+ with :
98+ name : chaostools-windows
99+ path : |
100+ tools
101+ !tools/src
102+ build_linux :
103+ name : Build on Linux
104+ needs : [build_tools_linux]
105+ strategy :
106+ matrix :
107+ type : ["floppy", "hd", "hd --mbr"]
108+ debug : ["", "--debug"]
109+ test : ["", "--test"]
110+ efi : ["", "--efi"]
111+ runs-on : ubuntu-latest
112+ steps :
113+ - uses : actions/checkout@v3
114+ - name : Install tools
115+ run : sudo apt install nasm make qemu-utils python3
116+ - name : Download additional tools artifact
117+ uses : actions/download-artifact@v3
118+ with :
119+ name : chaostools-linux.tar
120+ - name : Untar tools
121+ if : steps.cache.outputs.cache-hit != 'true'
122+ run : tar -xvf chaostools-linux.tar -C tools
123+ - name : Run the build script
61124 run : ./build_image.sh ${{ matrix.type }} ${{ matrix.debug }} ${{ matrix.test }} ${{ matrix.efi }} --user-programs-all
62125 shell : sh
63- - name : Run the build script (Windows)
64- if : runner.os == 'Windows'
126+ build_windows :
127+ name : Build on Windows
128+ needs : [build_tools_windows]
129+ strategy :
130+ matrix :
131+ type : ["floppy", "hd", "hd --mbr"]
132+ debug : ["", "--debug"]
133+ test : ["", "--test"]
134+ efi : ["", "--efi"]
135+ runs-on : windows-latest
136+ steps :
137+ - uses : actions/checkout@v3
138+ - name : Install nasm
139+ uses : ilammy/setup-nasm@v1
140+ - name : Install Python3
141+ uses : actions/setup-python@v4
142+ with :
143+ python-version : ' 3.11'
144+ - name : Install winget
145+ uses : Cyberboss/install-winget@v1
146+ - name : Install QEMU
147+ run : winget install --accept-source-agreements --accept-package-agreements --id=SoftwareFreedomConservancy.QEMU -e
148+ - name : Add QEMU to the PATH
149+ shell : pwsh
150+ run : |
151+ "C:\Program Files\qemu" >> $env:GITHUB_PATH
152+ - name : Download tools artifact
153+ uses : actions/download-artifact@v3
154+ with :
155+ name : chaostools-windows
156+ path : tools
157+ - name : Run the build script
65158 run : BUILD_IMAGE.BAT ${{ matrix.type }} ${{ matrix.debug }} ${{ matrix.test }} ${{ matrix.efi }} --user-programs-all
66159 shell : cmd
0 commit comments