forked from pytorch/cpuinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (115 loc) · 3.34 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
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
name: Build using CMake
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
cmake-linux-local:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
- name: Update apt
run: sudo apt update
- name: Install ninja
run: sudo apt install ninja-build
- name: Configure and build
run: scripts/local-build.sh
working-directory: ${{ github.workspace }}
cmake-darwin:
runs-on: macos-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
- name: Install ninja
run: brew install ninja
- name: Configure and build
run: scripts/local-build.sh
working-directory: ${{ github.workspace }}
cmake-windows:
runs-on: windows-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
- name: Install ninja
run: choco install ninja
- name: Configure and build
run: scripts/local-build.sh
shell: bash # Specify bash so we can reuse the build script on Windows (runs on Git bash)
working-directory: ${{ github.workspace }}
cmake-uwp:
runs-on: windows-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
- name: 'x64-uwp(Debug)'
uses: lukka/run-cmake@v10
with:
configurePreset: 'x64-uwp'
buildPreset: 'x64-uwp-dbg'
- name: 'x64-uwp(Release)'
uses: lukka/run-cmake@v10
with:
configurePreset: 'x64-uwp'
buildPreset: 'x64-uwp-rel'
- name: 'arm64-uwp(Debug)'
uses: lukka/run-cmake@v10
with:
configurePreset: 'arm64-uwp'
buildPreset: 'arm64-uwp-dbg'
- name: 'arm64-uwp(Release)'
uses: lukka/run-cmake@v10
with:
configurePreset: 'arm64-uwp'
buildPreset: 'arm64-uwp-rel'
cmake-android:
strategy:
matrix:
script: [android-arm64-build.sh, android-armv7-build.sh, android-riscv64-build.sh, android-x86-build.sh]
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
- name: Update apt
run: sudo apt update
- name: Install ninja
run: sudo apt install ninja-build
- name: Setup Android NDK
id: setup-ndk
uses: nttld/[email protected]
with:
ndk-version: r27
add-to-path: false
- name: Configure and build
run: scripts/${{ matrix.script }}
working-directory: ${{ github.workspace }}
env:
ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
cmake-linux-qemu:
runs-on: ubuntu-22.04
timeout-minutes: 40
strategy:
matrix:
build_props:
- [
"cmake-linux-riscv64",
"riscv64/ubuntu:22.04"
]
name: ${{ matrix.build_props[0] }}
steps:
- uses: actions/checkout@v2
- name: Setup QEMU
uses: docker/[email protected]
- name: Build cpuinfo in ${{ matrix.build_props[1] }}
run: |
docker run -i -v $(pwd):/cpuinfo ${{ matrix.build_props[1] }} /bin/bash -c "
apt update &&
apt install -y cmake git gcc g++ &&
cd /cpuinfo &&
scripts/local-build.sh"