Skip to content

Build

Build #18

Workflow file for this run

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 lib
cp -Verbose Bochs/bochs/cpu/libcpu.a lib/cpu.a
cp -Verbose Bochs/bochs/cpu/fpu/libfpu.a lib/fpu.a
cp -Verbose Bochs/bochs/cpu/avx/libavx.a lib/avx.a
cp -Verbose Bochs/bochs/cpu/cpudb/libcpudb.a lib/cpudb.a
- 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 lib
cp -v Bochs/bochs/cpu/libcpu.a lib/
cp -v Bochs/bochs/cpu/fpu/libfpu.a lib/
cp -v Bochs/bochs/cpu/avx/libavx.a lib/
cp -v Bochs/bochs/cpu/cpudb/libcpudb.a lib/
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: bochscpu-build-${{ matrix.variant.os }}-${{ matrix.variant.arch }}
path: lib