Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 0 additions & 72 deletions .github/workflows/ccpp.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI Tests

on:
pull_request:
paths-ignore: ['**.md']
branches:
- main

jobs:
# Validate code formatting
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup
run: |
sudo apt-get update
sudo apt-get install -y clang-format
shell: bash
- name: Validate Source Formatting
run: |
mapfile -t source < <(find . -iname "*.cc")
mapfile -t headers < <(find . -iname "*.hh")
code=("${source[@]}" "${headers[@]}")
if ! clang-format -style=file "${code[@]}" -i -Werror --dry-run; then
echo "You must run make format before submitting a pull request"
echo ""
git diff
exit 1
fi
echo "Your source is formatted real good!"
shell: bash

# Tests all build scenarios
build:
runs-on: ${{ matrix.os }}

# Test builds for several Ubuntus with both release and debug
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
build_type: [Release, Debug]

steps:
- uses: actions/checkout@v4

# Install build deps
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake libcurl4-gnutls-dev libboost-filesystem-dev ninja-build
shell: bash

# Run the build
- name: Validate ${{ matrix.build_type }} Build
run: |
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
ninja package
shell: bash

# Test the build
- name: Run tests
run: |
cd build/tests
./pdbfetch > /dev/null
./pdbdump > /dev/null
./pdbtypes > /dev/null
./pdbtypetree > /dev/null
./pdbwrapper > /dev/null

# Upload build .debs
- name: Archive debian packages
uses: actions/upload-artifact@v4
with:
name: libmspdb_${{ matrix.os }}_${{ matrix.build_type }}
path: build/*.deb
48 changes: 0 additions & 48 deletions .github/workflows/gh-release.yml

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Create Release

on:
push:
tags:
- 'v*'

jobs:
# Build and publish release assets
build:
runs-on: ${{ matrix.os }}

# Build releases for supported Ubuntu versions
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04]

steps:
- uses: actions/checkout@v4

# Install build deps
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake libcurl4-gnutls-dev libboost-filesystem-dev ninja-build
shell: bash

# Run the build
- name: ${{ matrix.os }} Build Release
run: |
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ..
ninja package
shell: bash

# Upload build .debs
- name: Archive debian release packages
uses: actions/upload-artifact@v4
with:
name: libmspdb_${{ matrix.os }}_Release
path: build/*.deb

# Create the release
release:
needs: build
runs-on: ubuntu-latest
steps:
# Download the built debs from the build job
- name: Download Release Artifacts
uses: actions/download-artifact@v4
with:
path: all-debs
pattern: libmspdb_*_Release
merge-multiple: true

# Create and upload the debs to a new release
- name: Upload Release Asset
id: upload-release-asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
la -alh ./all-debs
gh release create ${{ github.ref_name }} \
--title "Release ${{ github.ref_name }}" \
--draft \
./all-debs/*.deb
shell: bash
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ADD_SUBDIRECTORY(tests)
# Format target
ADD_CUSTOM_TARGET(
format
COMMAND find ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/include -name '*.hh' -o -iname '*.cc' | xargs clang-format -i -style=file
COMMAND find ${PROJECT_SOURCE_DIR}/tests ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/include -name '*.hh' -o -iname '*.cc' | xargs clang-format -i -style=file
)

# Install rule for include headers
Expand Down
2 changes: 1 addition & 1 deletion tests/pdbdump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using namespace mspdb;
using namespace std;

int main() {
PDB pdb("/home/papes/git/libmspdb/ntkrnlmp.pdb");
PDB pdb("./pdbstore/ntdll.pdb/08A413EE85E91D0377BA33DC3A2641941/ntdll.pdb");

cout << "BlockSize: " << pdb.block_size() << '\n';
cout << "NumBlocks: " << pdb.num_blocks() << '\n';
Expand Down
2 changes: 1 addition & 1 deletion tests/pdbfetch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ using namespace mspdb;

int main() {
PDBStore store("./pdbstore/");
auto pdb = store.open_pdb("win32u.pdb", "C0685FE74DEEA4BEC6F9CC52FEAC5D231");
auto pdb = store.open_pdb("ntdll.pdb", "08A413EE85E91D0377BA33DC3A2641941");
}
2 changes: 1 addition & 1 deletion tests/pdbtypes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ void TypeContainer::write_member(const LF_MEMBER& lfMember) const {
}

int main() {
PDB pdb("/home/papes/git/libmspdb/ntkrnlmp.pdb");
PDB pdb("./pdbstore/ntdll.pdb/08A413EE85E91D0377BA33DC3A2641941/ntdll.pdb");
const auto& tpi = pdb.stream_directory().type_info_stream();

for (const LF_STRUCTURE& lfStruct : tpi.structs()) {
Expand Down
Loading