2022-11-19 16:26:16 +01:00
|
|
|
name: Push
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- "**"
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
jobs:
|
2023-02-23 00:17:23 +01:00
|
|
|
Linux_x86_64:
|
|
|
|
name: 'Linux x86_64'
|
2022-11-19 16:26:16 +01:00
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
container:
|
|
|
|
image: ubuntu:22.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: apt
|
|
|
|
run: |
|
|
|
|
apt update -y
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt install -y \
|
2023-03-08 23:48:35 +01:00
|
|
|
gcc g++-12 \
|
2022-11-19 16:26:16 +01:00
|
|
|
libcapstone-dev \
|
|
|
|
libcapstone4 \
|
2023-03-08 23:48:35 +01:00
|
|
|
make
|
2022-11-19 16:26:16 +01:00
|
|
|
- name: make
|
|
|
|
run: make TARGET=x86_64 all
|
|
|
|
- name: test
|
2023-03-08 23:48:35 +01:00
|
|
|
run: make CXX=g++-12 TARGET=x86_64 test-ci
|
2023-02-23 00:17:23 +01:00
|
|
|
Linux_i386:
|
|
|
|
name: 'Linux i386'
|
2022-11-19 16:26:16 +01:00
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
container:
|
|
|
|
image: ubuntu:22.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: apt
|
|
|
|
run: |
|
|
|
|
dpkg --add-architecture i386
|
|
|
|
apt update -y
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt install -y \
|
2023-03-08 23:48:35 +01:00
|
|
|
gcc g++-12 \
|
2022-11-19 16:26:16 +01:00
|
|
|
gcc-multilib \
|
|
|
|
libc6:i386 \
|
|
|
|
make \
|
|
|
|
wget
|
|
|
|
- name: Build capstone
|
|
|
|
run: |
|
|
|
|
# capstone isn't distributed for 32-bit so we need to build it manually
|
|
|
|
wget https://github.com/capstone-engine/capstone/archive/4.0.2.tar.gz -O capstone.tar.gz
|
|
|
|
tar zxvf capstone.tar.gz
|
|
|
|
cd capstone-4.0.2
|
|
|
|
./make.sh nix32
|
|
|
|
./make.sh install
|
|
|
|
cd ..
|
|
|
|
rm -rf capstone-4.0.2 capstone.tar.gz
|
|
|
|
- name: make
|
|
|
|
run: make TARGET=x86 all
|
|
|
|
- name: test
|
2023-03-08 23:48:35 +01:00
|
|
|
run: make CXX=g++-12 TARGET=x86 test-ci
|
2023-02-23 00:17:23 +01:00
|
|
|
Linux_aarch64:
|
|
|
|
name: 'Linux aarch64'
|
2022-11-19 16:26:16 +01:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: uraimo/run-on-arch-action@v2
|
|
|
|
name: QEMU
|
|
|
|
id: runcmd
|
|
|
|
with:
|
|
|
|
arch: aarch64
|
|
|
|
distro: ubuntu22.04
|
|
|
|
githubToken: ${{ github.token }}
|
|
|
|
install: |
|
|
|
|
apt update -y
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt install -y \
|
2023-03-08 23:48:35 +01:00
|
|
|
gcc g++-12 \
|
2022-11-19 16:26:16 +01:00
|
|
|
libc6 \
|
|
|
|
libcapstone-dev \
|
|
|
|
libcapstone4 \
|
2023-03-08 23:48:35 +01:00
|
|
|
make
|
2022-11-19 16:26:16 +01:00
|
|
|
run: |
|
|
|
|
make CC=gcc TARGET=aarch64 all
|
|
|
|
# FIXME: For some reason some of the object files are rebuilt
|
2023-03-08 23:48:35 +01:00
|
|
|
make CC=gcc CXX=g++-12 TARGET=aarch64 test-ci
|
2023-02-21 00:16:42 +01:00
|
|
|
|
2023-02-23 00:17:23 +01:00
|
|
|
Windows:
|
2023-02-21 00:16:42 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
arch: [x86, amd64]
|
2023-06-16 21:48:25 +02:00
|
|
|
runs-on: windows-2019
|
2023-02-21 00:16:42 +01:00
|
|
|
steps:
|
2023-03-02 02:11:08 +01:00
|
|
|
- uses: actions/checkout@v3
|
2023-02-21 00:16:42 +01:00
|
|
|
- uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
with:
|
|
|
|
arch: ${{ matrix.arch }}
|
2023-03-02 02:11:08 +01:00
|
|
|
- name: Prepare env
|
|
|
|
shell: powershell
|
|
|
|
run: |
|
|
|
|
$tag = (nmake -nologo -f win32\Makefile capstone_tag).Trim()
|
|
|
|
echo ("CAPSTONE_TAG=" + $tag) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
$dir = (nmake -nologo -f win32\Makefile capstone_dir).Trim()
|
|
|
|
echo ("CAPSTONE_DIR=" + $dir) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
echo ("VCVER=" + $env:VCToolsVersion) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
- name: Cache capstone
|
|
|
|
id: cache-capstone
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ${{ env.CAPSTONE_DIR }}
|
|
|
|
key: capstone-${{ matrix.arch }}-${{ env.CAPSTONE_TAG }}-${{ env.VCVER }}-0
|
|
|
|
- if: ${{ steps.cache-capstone.outputs.cache-hit != 'true' }}
|
|
|
|
name: Prepare capstone
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
|
|
|
nmake -nologo -f win32\Makefile capstone
|
2023-02-21 00:17:57 +01:00
|
|
|
- name: Build
|
|
|
|
shell: cmd
|
2023-03-02 02:11:08 +01:00
|
|
|
run: nmake -nologo -f win32/Makefile
|
2023-02-21 00:17:57 +01:00
|
|
|
- name: Test
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
2023-03-02 02:11:08 +01:00
|
|
|
nmake -nologo -f win32/Makefile test-ci
|
2023-02-21 00:17:57 +01:00
|
|
|
|