|
8 | 8 | tags:
|
9 | 9 | - 'v*'
|
10 | 10 |
|
| 11 | +env: |
| 12 | + NB_CPU: 1 |
| 13 | + |
11 | 14 | jobs:
|
12 | 15 | bochscpu:
|
| 16 | + env: |
| 17 | + BOCHS_REV: 8dd9649389c813a189e3f702d58cdedb93730343 |
13 | 18 | strategy:
|
14 | 19 | fail-fast: false
|
15 | 20 | matrix:
|
|
19 | 24 | - {os: macos-latest, arch: x64}
|
20 | 25 | runs-on: ${{ matrix.variant.os }}
|
21 | 26 | name: bochscpu / ${{ matrix.variant.os }} / ${{ matrix.variant.arch }}
|
22 |
| - steps: |
| 27 | + steps : |
23 | 28 | - name: Checkout
|
24 | 29 | uses: actions/checkout@v3
|
25 | 30 |
|
|
28 | 33 | uses: actions/cache@v3
|
29 | 34 | with:
|
30 | 35 | path: artifact
|
31 |
| - key: bochscpu-${{ matrix.variant.os }}-${{ matrix.variant.arch }}-artifact-win-lin |
| 36 | + key: bochscpu-libs-${{ matrix.variant.os }}-${{ matrix.variant.arch }}-${{ env.BOCHS_REV }} |
| 37 | + |
| 38 | + - if: steps.cache-artifacts.outputs.cache-hit != 'true' && matrix.variant.os == 'windows-latest' |
| 39 | + run: | |
| 40 | + echo NB_CPU=$env:NUMBER_OF_PROCESSORS | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
| 41 | +
|
| 42 | + - if: steps.cache-artifacts.outputs.cache-hit != 'true' && matrix.variant.os == 'ubuntu-latest' |
| 43 | + run: | |
| 44 | + echo "NB_CPU=$(grep -c ^processor /proc/cpuinfo)" >> $GITHUB_ENV |
| 45 | +
|
| 46 | + - if: steps.cache-artifacts.outputs.cache-hit != 'true' && matrix.variant.os == 'macos-latest' |
| 47 | + run: | |
| 48 | + echo NB_CPU=$(sysctl -n hw.ncpu) >> $GITHUB_ENV |
32 | 49 |
|
33 | 50 | - uses: microsoft/setup-msbuild@v1
|
34 | 51 | if: steps.cache-artifacts.outputs.cache-hit != 'true' && matrix.variant.os == 'windows-latest'
|
|
48 | 65 | - name: Build BochsCPU (Linux & MacOS)
|
49 | 66 | if: steps.cache-artifacts.outputs.cache-hit != 'true' && matrix.variant.os != 'windows-latest'
|
50 | 67 | run: |
|
51 |
| - chmod +x .github/build-bochscpu.sh; .github/build-bochscpu.sh |
| 68 | + bash .github/build-bochscpu.sh |
52 | 69 | mkdir artifact artifact/Release artifact/Debug artifact/RelWithDebInfo
|
53 | 70 | cp -v bxbuild/bochscpu-ffi/target/release/lib*.a artifact/Release/
|
54 | 71 | cp -v bxbuild/bochscpu-ffi/target/debug/lib*.a artifact/Debug/
|
|
57 | 74 | - name: Upload artifacts
|
58 | 75 | uses: actions/upload-artifact@v3
|
59 | 76 | with:
|
| 77 | + if-no-files-found: error |
60 | 78 | name: bochscpu-libs-${{ matrix.variant.os }}-${{ matrix.variant.arch }}
|
61 | 79 | path: artifact
|
62 | 80 |
|
|
74 | 92 | runs-on: ${{ matrix.variant.os }}
|
75 | 93 | name: bindings / ${{ matrix.variant.os }} / ${{ matrix.python-version }} / ${{ matrix.variant.config }}
|
76 | 94 | env:
|
77 |
| - NB_CPU: 1 |
78 | 95 | CMAKE_FLAGS: ""
|
79 | 96 | steps:
|
80 | 97 | - name: Checkout
|
@@ -104,8 +121,8 @@ jobs:
|
104 | 121 | - name: Environment Setup (Windows)
|
105 | 122 | if: matrix.variant.os == 'windows-latest'
|
106 | 123 | run: |
|
107 |
| - echo "NB_CPU=$env:NUMBER_OF_PROCESSORS" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
108 |
| - echo "CMAKE_ARCH='-A ${{ matrix.variant.arch }}'" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
| 124 | + echo NB_CPU=$env:NUMBER_OF_PROCESSORS | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
| 125 | + echo CMAKE_ARCH='-A ${{ matrix.variant.arch }}' | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
109 | 126 | Import-Module .\.github\Invoke-VisualStudio.ps1
|
110 | 127 | Invoke-VisualStudio2022${{ matrix.variant.arch }}
|
111 | 128 |
|
|
0 commit comments