mirror of
https://github.com/radareorg/sdb.git
synced 2026-11-10 04:11:25 -10:00
230 lines
6.1 KiB
YAML
230 lines
6.1 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
|
|
jobs:
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Windows Dependencies
|
|
run: pip install meson ninja
|
|
- name: Building Sdb
|
|
run: meson build && ninja -C build
|
|
- name: Pub
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: sdb_windows
|
|
path: build/*.exe
|
|
build-cxx:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Building Sdb
|
|
run: make xxx
|
|
- name: Testing gperf
|
|
run: make -C test
|
|
build-python:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Building Sdb
|
|
run: export CFLAGS=-O0 ; make
|
|
- name: Building python bindings
|
|
run: make -C bindings/python
|
|
- name: Testing python bindings
|
|
run: cd bindings/python && python3 test.py
|
|
test-asan:
|
|
runs-on: ubuntu-latest
|
|
continue-on-error: true
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: install gperf
|
|
run: sudo apt install gperf
|
|
- name: building sdb
|
|
run: make asan
|
|
- name: running tests
|
|
run: make asantest
|
|
- name: testing gperf
|
|
run: make -C test/gperf
|
|
# test-leaks:
|
|
# runs-on: ubuntu-latest
|
|
# continue-on-error: true
|
|
# steps:
|
|
# - uses: actions/checkout@v6
|
|
# - name: install gperf
|
|
# run: sudo apt install gperf
|
|
# - name: building sdb
|
|
# run: make asan
|
|
# - name: running tests
|
|
# run: make leaktest
|
|
# - name: testing gperf
|
|
# run: make -C test/gperf
|
|
build-linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Meson Sdb
|
|
run: |
|
|
pip install meson ninja
|
|
meson b && ninja -C b
|
|
- name: Building Sdb
|
|
run: export CFLAGS="-Werror -Wall" && make -j4
|
|
- name: Install gperf
|
|
run: sudo apt install gperf
|
|
- name: Packaging
|
|
run: make -C dist/debian
|
|
- name: Running tests
|
|
run: make test
|
|
- name: Testing gperf
|
|
run: make -C test/gperf
|
|
- name: Pub
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: sdb_linux
|
|
path: dist/debian/sdb/*.deb
|
|
build-heap:
|
|
runs-on: ubuntu-latest
|
|
continue-on-error: true
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Building Sdb
|
|
run: export CFLAGS="-DUSE_SDB_HEAP=1 -Werror -Wall" && make -j4
|
|
- name: Running tests
|
|
run: make test
|
|
# - name: Testing gperf
|
|
# run: make -C test/gperf
|
|
build-macos:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Building Sdb
|
|
run: make -j4 && cd ..
|
|
- name: Packaging
|
|
run: cd dist/macos && make && cd ../../..
|
|
- name: Running tests
|
|
run: make test
|
|
- name: Pub
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: sdb_macos
|
|
path: dist/macos/*.pkg
|
|
build-cydia:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Cloning Repo
|
|
run: git clone --depth=1 https://github.com/radareorg/sdb
|
|
- name: Building Sdb
|
|
run: cd sdb && make ios && cd ..
|
|
- name: Packaging
|
|
run: cd sdb/dist/cydia && make && cd ../../..
|
|
- name: Pub
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: sdb_cydia
|
|
path: sdb/dist/cydia/*/*.deb
|
|
msys2-w64-meson:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
sys: [MINGW64, UCRT64]
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Setup MSYS2
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
msystem: ${{ matrix.sys }}
|
|
update: true
|
|
install: base-devel git
|
|
pacboy: >-
|
|
cc:p
|
|
meson:p
|
|
ninja:p
|
|
- name: Configure Build
|
|
shell: msys2 {0}
|
|
run: |
|
|
prefix=$(case "${{ matrix.sys }}" in
|
|
MINGW64) echo /mingw64 ;;
|
|
UCRT64) echo /ucrt64 ;;
|
|
esac)
|
|
meson setup build --prefix=$prefix
|
|
- name: Compile Project
|
|
shell: msys2 {0}
|
|
run: meson compile -C build
|
|
|
|
check_release:
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
|
outputs:
|
|
is_release: ${{ steps.release.outputs.is }}
|
|
tag_name: ${{ steps.release.outputs.tag }}
|
|
needs:
|
|
- build-windows
|
|
- build-cxx
|
|
- build-python
|
|
- test-asan
|
|
- build-linux
|
|
- build-heap
|
|
- build-macos
|
|
- build-cydia
|
|
- msys2-w64-meson
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0 # Download all git history and tags
|
|
- name: Check if is a release
|
|
run: |
|
|
TAG="`git describe --exact-match --tags ${{ github.sha }} || true`"
|
|
if [ -n "$TAG" ]; then
|
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
|
echo "is=yes" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "is=no" >> $GITHUB_OUTPUT
|
|
fi
|
|
id: release
|
|
|
|
release:
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && needs.check_release.outputs.is_release == 'yes' }}
|
|
needs:
|
|
- check_release
|
|
runs-on: ubuntu-24.04
|
|
env:
|
|
ASSET_FILES: |
|
|
dist/artifacts/sdb_windows/*.exe
|
|
dist/artifacts/sdb_linux/*.deb
|
|
dist/artifacts/sdb_macos/*.pkg
|
|
dist/artifacts/sdb_cydia/*.deb
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0 # Download all git history and tags
|
|
- name: Extract sdb version
|
|
shell: bash
|
|
run: echo "branch=`grep SDB_VERSION include/sdb/version.h | cut -d '"' -f 2`" >> $GITHUB_OUTPUT
|
|
id: version
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v7
|
|
with:
|
|
path: dist/artifacts
|
|
- name: Create GitHub release
|
|
id: create_release
|
|
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
|
|
with:
|
|
name: ${{ steps.version.outputs.branch }}
|
|
tag_name: ${{ needs.check_release.outputs.tag_name }}
|
|
body_path: ./RELEASE_NOTES.md
|
|
draft: false
|
|
prerelease: false
|
|
generate_release_notes: false
|
|
files: |
|
|
${{ env.ASSET_FILES }}
|
|
checksums.txt
|
|
|