-
Notifications
You must be signed in to change notification settings - Fork 8
81 lines (71 loc) · 2.5 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
name: Build
on:
pull_request:
push:
branches:
- main
schedule:
- cron: 0 0 * * *
jobs:
bochscpu:
env:
NB_CPU: 1
strategy:
fail-fast: false
matrix:
variant:
- {os: windows-latest, arch: x64}
- {os: ubuntu-latest, arch: x64}
- {os: macos-latest, arch: x64}
runs-on: ${{ matrix.variant.os }}
name: ${{ matrix.variant.os }} / ${{ matrix.variant.arch }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Initialization (Windows)
if: matrix.variant.os == 'windows-latest'
run: echo "NB_CPU=$env:NUMBER_OF_PROCESSORS" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Initialization (Linux)
if: matrix.variant.os == 'ubuntu-latest'
run: echo "NB_CPU=$(grep -c ^processor /proc/cpuinfo)" >> $GITHUB_ENV
- name: Initialization (MacOS)
if: matrix.variant.os == 'macos-latest'
run: echo "NB_CPU=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
- uses: microsoft/setup-msbuild@v1
if: matrix.variant.os == 'windows-latest'
- uses: ilammy/msvc-dev-cmd@v1
if: matrix.variant.os == 'windows-latest'
- name: Build BochsCPU (Windows)
if: matrix.variant.os == 'windows-latest'
shell: powershell
run: |
bash -c 'sh prep.sh; cd Bochs/bochs; sh .conf.cpu-msvc;'
cd Bochs/bochs
Start-Process nmake -ErrorAction SilentlyContinue -PassThru -Wait
cd ../..
mkdir -p artifact/lib
cp -Verbose Bochs/bochs/cpu/libcpu.a artifact/lib/cpu.lib
cp -Verbose Bochs/bochs/cpu/fpu/libfpu.a artifact/lib/fpu.lib
cp -Verbose Bochs/bochs/cpu/avx/libavx.a artifact/lib/avx.lib
cp -Verbose Bochs/bochs/cpu/cpudb/libcpudb.a artifact/lib/cpudb.lib
cp -Verbose -r Bochs/bochs artifact/
- name: Build BochsCPU (Linux & MacOS)
if: matrix.variant.os != 'windows-latest'
shell: bash
run: |
sh prep.sh
cd Bochs/bochs
sh .conf.cpu
make -j ${{ env.NB_CPU }} || true
cd ../..
mkdir -p artifact/lib
cp -v Bochs/bochs/cpu/libcpu.a artifact/lib/
cp -v Bochs/bochs/cpu/fpu/libfpu.a artifact/lib/
cp -v Bochs/bochs/cpu/avx/libavx.a artifact/lib/
cp -v Bochs/bochs/cpu/cpudb/libcpudb.a artifact/lib/
cp -r -v Bochs/bochs artifact/
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: bochscpu-build-${{ matrix.variant.os }}-${{ matrix.variant.arch }}
path: artifact