|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +permissions: {} |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +jobs: |
| 16 | + lint: |
| 17 | + name: lint |
| 18 | + runs-on: ubuntu-latest |
| 19 | + permissions: |
| 20 | + contents: read |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 23 | + with: |
| 24 | + persist-credentials: false |
| 25 | + |
| 26 | + - uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 |
| 27 | + with: |
| 28 | + distribution: temurin |
| 29 | + java-version: "25" |
| 30 | + cache: maven |
| 31 | + |
| 32 | + - uses: ./.github/actions/install-tools |
| 33 | + with: |
| 34 | + tools: just |
| 35 | + |
| 36 | + - name: Lint |
| 37 | + run: just lint |
| 38 | + |
| 39 | + - name: Install zizmor |
| 40 | + run: pip install zizmor==1.23.1 |
| 41 | + - name: Run zizmor |
| 42 | + run: zizmor --format plain .github/ |
| 43 | + |
| 44 | + test: |
| 45 | + name: "test (java ${{ matrix.java-version }})" |
| 46 | + runs-on: ubuntu-latest |
| 47 | + permissions: |
| 48 | + contents: read |
| 49 | + strategy: |
| 50 | + fail-fast: false |
| 51 | + matrix: |
| 52 | + java-version: ["22", "25"] |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 55 | + with: |
| 56 | + persist-credentials: false |
| 57 | + |
| 58 | + - uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 |
| 59 | + with: |
| 60 | + distribution: temurin |
| 61 | + java-version: ${{ matrix.java-version }} |
| 62 | + cache: maven |
| 63 | + |
| 64 | + - uses: ./.github/actions/install-tools |
| 65 | + with: |
| 66 | + tools: just |
| 67 | + |
| 68 | + - name: Stage libhegel from the matching GitHub release |
| 69 | + id: libhegel |
| 70 | + run: | |
| 71 | + set -euo pipefail |
| 72 | + VERSION=$(grep -oP 'LIBHEGEL_VERSION = "\K[^"]+' src/main/java/dev/hegel/LibraryLoader.java) |
| 73 | + ASSET="libhegel-linux-amd64.so" |
| 74 | + URL_BASE="https://github.com/hegeldev/hegel-rust/releases/download/v${VERSION}" |
| 75 | + DEST="${RUNNER_TEMP}/libhegel.so" |
| 76 | + curl -fsSL -o "${DEST}" "${URL_BASE}/${ASSET}" |
| 77 | + curl -fsSL -o "${DEST}.sha256" "${URL_BASE}/${ASSET}.sha256" |
| 78 | + # The published .sha256 file is GNU sha256sum style: <digest> <asset>. |
| 79 | + WANT=$(awk '{print $1}' "${DEST}.sha256") |
| 80 | + echo "${WANT} ${DEST}" | sha256sum -c - |
| 81 | + echo "path=${DEST}" >> "$GITHUB_OUTPUT" |
| 82 | +
|
| 83 | + - name: Test with 100% coverage enforcement |
| 84 | + env: |
| 85 | + # An explicit path disables the auto-downloader; the engine runs in-process. |
| 86 | + HEGEL_LIBHEGEL_PATH: ${{ steps.libhegel.outputs.path }} |
| 87 | + run: just coverage |
| 88 | + |
| 89 | + docs: |
| 90 | + name: docs |
| 91 | + runs-on: ubuntu-latest |
| 92 | + permissions: |
| 93 | + contents: read |
| 94 | + steps: |
| 95 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 96 | + with: |
| 97 | + persist-credentials: false |
| 98 | + |
| 99 | + - uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 |
| 100 | + with: |
| 101 | + distribution: temurin |
| 102 | + java-version: "25" |
| 103 | + cache: maven |
| 104 | + |
| 105 | + - uses: ./.github/actions/install-tools |
| 106 | + with: |
| 107 | + tools: just |
| 108 | + |
| 109 | + - name: Build Javadoc |
| 110 | + run: just docs |
0 commit comments