diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..f674c562 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,110 @@ +name: CI + +on: + push: + branches: [ master, main ] + pull_request: + branches: [ master, main ] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + autoconf \ + automake \ + build-essential \ + perl \ + patch \ + diffutils \ + xmlto \ + libpcre2-dev + + - name: Bootstrap + run: ./bootstrap + + - name: Configure + run: | + ./configure \ + --with-pcre2 + + - name: Build + run: make -j$(nproc) + + - name: Run tests + run: make check + + - name: Show test results on failure + if: failure() + run: | + echo "=== Test logs ===" + find . -name "*.log" -type f -exec echo "=== {} ===" \; -exec cat {} \; + echo "=== Test arena contents ===" + find test-arena -type f 2>/dev/null | head -20 | while read f; do + echo "=== $f ===" + cat "$f" 2>/dev/null || echo "Cannot read file" + done + + test-without-pcre2: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies (without PCRE2) + run: | + sudo apt-get update + sudo apt-get install -y \ + autoconf \ + automake \ + build-essential \ + perl \ + patch \ + diffutils \ + xmlto + + - name: Bootstrap + run: ./bootstrap + + - name: Configure without PCRE2 + run: ./configure --without-pcre2 + + - name: Build + run: make -j$(nproc) + + - name: Run tests + run: make check + + test-distcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + autoconf \ + automake \ + build-essential \ + perl \ + patch \ + diffutils \ + xmlto \ + libpcre2-dev + + - name: Bootstrap + run: ./bootstrap + + - name: Configure + run: ./configure --with-pcre2 + + - name: Build and test distribution + run: make distcheck + +