-
-
Notifications
You must be signed in to change notification settings - Fork 179
145 lines (143 loc) · 4.34 KB
/
ci.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: CI
on: [push, pull_request]
# cancel older workflow runs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
CMAKE_ARGS:
-
- -DCMAKE_BUILD_TYPE=Debug
- -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- run: cmake ${{ matrix.CMAKE_ARGS }} .
- run: make -j4 VERBOSE=1
- if: ${{ ! contains(matrix.CMAKE_ARGS, 'CMAKE_BUILD_TYPE') }}
run: make -j4 test ARGS=-V
- if: ${{ contains(matrix.CMAKE_ARGS, 'CMAKE_BUILD_TYPE') }}
run: ./SMHasher --test=Sanity,Speed,Cyclic,Zeroes,Seed
aarch64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-unknown-linux-gnu
- run: sudo gem install apt-spy2 && sudo apt-spy2 fix
- run: sudo apt-get update -y
- run: sudo apt-get install -o Acquire::Retries=5 -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- run: cmake -DCMAKE_TOOLCHAIN_FILE=CMakeARM64Cross.txt -DRUST_TARGET=aarch64-unknown-linux-gnu
- run: make -j4 VERBOSE=1
armv7:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
with:
targets: armv7-unknown-linux-gnueabihf
- run: sudo gem install apt-spy2 && sudo apt-spy2 fix
- run: sudo apt-get update -y
- run: sudo apt-get install -o Acquire::Retries=5 -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
- run: cmake -DCMAKE_TOOLCHAIN_FILE=CMakeARMCross.txt -DRUST_TARGET=armv7-unknown-linux-gnueabihf
- run: make -j4 VERBOSE=1
macOS:
name: macOS
runs-on: macOS-latest
steps:
#- name: init
# run: brew install automake
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: true
- uses: dtolnay/rust-toolchain@stable
- run: CXXFLAGS='-std=c++17' cmake .
- run: make -j4 VERBOSE=1
- run: make -j4 test ARGS=-V
windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- run: cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release .
- run: cmake --build . --config Release --verbose
- run: Release\SMHasher.exe --test=VerifyAll,Sanity,Speed,Cyclic,Zeroes,Seed
mingw:
name: mingw
runs-on: windows-latest
env:
MSYS2_DIR: msys64
MSYS2_ARCH: x86_64
MSYSTEM: MINGW64
ARCH: win64
PLATFORM: x64
#PATH: "C:\%MSYS2_DIR%\%MSYSTEM%\bin;C:\%MSYS2_DIR%\usr\bin;%PATH%"
steps:
# see https://github.com/msys2/setup-msys2
- name: setup-msys2
uses: msys2/setup-msys2@v2
with:
path-type: minimal
update: true
install: >-
git
cmake
base-devel
mingw-w64-x86_64-toolchain
- uses: dtolnay/rust-toolchain@stable
- run: reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting" /f /v DontShowUI /d 1
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: recursive
- shell: msys2 {0}
run: cmake .
- shell: msys2 {0}
run: make -j4 VERBOSE=1
continue-on-error: true
- shell: msys2 {0}
run: make -j4 test ARGS=-V
continue-on-error: true
rust_check:
name: check rust bindings
runs-on: ubuntu-latest
env:
RUST_GENERATE_BINDINGS: 1
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: recursive
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- run: |
cd rust-hashes
mv rust_hashes.h committed.h
cargo build # regenerate the bindings
diff -up committed.h rust_hashes.h
if [ $? -eq 0 ]; then
echo "Files match"
else
echo "Binding files changed or do not match"
echo "regenerate them with `RUST_GENERATE_BINDINGS=1 cargo +nightly build`"
exit 1
fi