| 1 |
name: Run Test |
| 2 |
on: |
| 3 |
push: |
| 4 |
paths-ignore: |
| 5 |
- ".gitignore" |
| 6 |
- "docs/**" |
| 7 |
- "ChangeLog" |
| 8 |
- "CREDITS.TXT" |
| 9 |
- "COMPILE.TXT" |
| 10 |
- "COMPILE_MSVC.TXT" |
| 11 |
- "COMPILE_CMAKE.TXT" |
| 12 |
- "HACK.TXT" |
| 13 |
- "LICENSE.TXT" |
| 14 |
- "LICENSE_LLVM.TXT" |
| 15 |
- "README.md" |
| 16 |
- "RELEASE_NOTES" |
| 17 |
- "SPONSORS.TXT" |
| 18 |
- "TODO" |
| 19 |
pull_request: |
| 20 |
|
| 21 |
env: |
| 22 |
CI: true |
| 23 |
|
| 24 |
jobs: |
| 25 |
Linux: |
| 26 |
runs-on: ${{ matrix.config.os }} |
| 27 |
name: ${{ matrix.config.name }} |
| 28 |
strategy: |
| 29 |
fail-fast: false |
| 30 |
matrix: |
| 31 |
config: |
| 32 |
- { |
| 33 |
name: 'ubuntu-18.04 x64 python2.7 make', |
| 34 |
os: ubuntu-18.04, |
| 35 |
arch: x64, |
| 36 |
python-arch: x64, |
| 37 |
python-version: '2.7', |
| 38 |
build-system: 'make', |
| 39 |
} |
| 40 |
- { |
| 41 |
name: 'ubuntu-18.04 x64 python3.6 make', |
| 42 |
os: ubuntu-18.04, |
| 43 |
arch: x64, |
| 44 |
python-arch: x64, |
| 45 |
python-version: '3.6', |
| 46 |
build-system: 'make', |
| 47 |
} |
| 48 |
- { |
| 49 |
name: 'ubuntu-20.04 x64 python2.7 make', |
| 50 |
os: ubuntu-20.04, |
| 51 |
arch: x64, |
| 52 |
python-arch: x64, |
| 53 |
python-version: '2.7', |
| 54 |
build-system: 'make', |
| 55 |
} |
| 56 |
- { |
| 57 |
name: 'ubuntu-20.04 x64 python3.9 make', |
| 58 |
os: ubuntu-20.04, |
| 59 |
arch: x64, |
| 60 |
python-arch: x64, |
| 61 |
python-version: '3.9', |
| 62 |
build-system: 'make', |
| 63 |
} |
| 64 |
- { |
| 65 |
name: 'ubuntu-20.04 x64 python3.9 cmake', |
| 66 |
os: ubuntu-20.04, |
| 67 |
arch: x64, |
| 68 |
python-arch: x64, |
| 69 |
python-version: '3.9', |
| 70 |
build-system: 'cmake', |
| 71 |
} |
| 72 |
|
| 73 |
steps: |
| 74 |
- uses: actions/checkout@v2 |
| 75 |
|
| 76 |
- name: Set up Python |
| 77 |
uses: actions/setup-python@v2 |
| 78 |
with: |
| 79 |
python-version: ${{ matrix.config.python-version }} |
| 80 |
|
| 81 |
- name: prepare |
| 82 |
shell: 'script -q -e -c "bash {0}"' |
| 83 |
run: | |
| 84 |
export LD_LIBRARY_PATH=`pwd`/tests/:$LD_LIBRARY_PATH |
| 85 |
wget https://github.com/groundx/capstonefuzz/raw/master/corpus/corpus-libFuzzer-capstone_fuzz_disasmnext-latest.zip |
| 86 |
unzip -q corpus-libFuzzer-capstone_fuzz_disasmnext-latest.zip -d suite/fuzz |
| 87 |
git clone https://git.cryptomilk.org/projects/cmocka.git suite/cstest/cmocka |
| 88 |
chmod +x suite/cstest/build_cstest.sh |
| 89 |
|
| 90 |
- name: make |
| 91 |
if: startsWith(matrix.config.build-system, 'make') |
| 92 |
shell: 'script -q -e -c "bash {0}"' |
| 93 |
run: | |
| 94 |
./make.sh |
| 95 |
make check |
| 96 |
sudo make install |
| 97 |
|
| 98 |
- name: cmake |
| 99 |
if: startsWith(matrix.config.build-system, 'cmake') |
| 100 |
shell: 'script -q -e -c "bash {0}"' |
| 101 |
run: | |
| 102 |
mkdir build |
| 103 |
cd build |
| 104 |
cmake -DCAPSTONE_INSTALL=1 .. |
| 105 |
cmake --build . --config Release |
| 106 |
sudo make install |
| 107 |
|
| 108 |
- name: build python binding |
| 109 |
shell: 'script -q -e -c "bash {0}"' |
| 110 |
run: | |
| 111 |
cp libcapstone.so.* bindings/python/libcapstone.so |
| 112 |
cd bindings/python && make check; cd ../..; |
| 113 |
|
| 114 |
- name: cstest |
| 115 |
shell: 'script -q -e -c "bash {0}"' |
| 116 |
run: | |
| 117 |
cd suite/cstest && ./build_cstest.sh; |
| 118 |
python cstest_report.py -D -t build/cstest -d ../MC; |
| 119 |
python cstest_report.py -D -t build/cstest -f issues.cs; cd ..; |
| 120 |
|
| 121 |
Windows: |
| 122 |
runs-on: ${{ matrix.config.os }} |
| 123 |
name: ${{ matrix.config.name }} |
| 124 |
strategy: |
| 125 |
fail-fast: false |
| 126 |
matrix: |
| 127 |
config: |
| 128 |
- name: 'windows x64 MSVC 64bit' |
| 129 |
os: windows-latest |
| 130 |
arch: x64 |
| 131 |
platform: windows |
| 132 |
python-arch: x64 |
| 133 |
python-version: '3.9' |
| 134 |
|
| 135 |
steps: |
| 136 |
- uses: actions/checkout@v3 |
| 137 |
|
| 138 |
- uses: lukka/get-cmake@latest |
| 139 |
name: Get CMake |
| 140 |
|
| 141 |
- name: '🛠️ Win MSVC 64 setup' |
| 142 |
if: contains(matrix.config.name, 'MSVC 64') |
| 143 |
uses: ilammy/msvc-dev-cmd@v1 |
| 144 |
with: |
| 145 |
arch: 'x64' |
| 146 |
|
| 147 |
- name: '🚧 Win MSVC 64 build' |
| 148 |
if: contains(matrix.config.name, 'MSVC 64') |
| 149 |
shell: bash |
| 150 |
run: | |
| 151 |
cmake --version |
| 152 |
cmake --preset=${{ matrix.config.platform }}-x64 |
| 153 |
cmake --build --preset build-${{ matrix.config.platform }}-release |
| 154 |
cmake --build --preset install-${{ matrix.config.platform }}-release |