From 3db8a8b76a66e39e5eac385986583ad30113a55a Mon Sep 17 00:00:00 2001 From: jamie Date: Sun, 27 Sep 2026 12:11:43 +0100 Subject: [PATCH 1/2] ci: add test and build workflow --- .github/workflows/ci.yml | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9c72bd9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable + with: + toolchain: stable + components: clippy, rustfmt + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 + - run: cargo fmt --check + - run: cargo clippy --all-targets --release -- -D warnings + - run: cargo test --release + - run: shellcheck bin/gh-img scripts/*.sh deploy/install.sh + - run: sudo apt-get update -q && sudo apt-get install -y -q libimage-exiftool-perl + - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 + - run: scripts/check-fixtures.sh + + build: + runs-on: ubuntu-latest + env: + TARGET: x86_64-unknown-linux-musl + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable + with: + toolchain: stable + targets: x86_64-unknown-linux-musl + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 + - uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 + with: + version: 0.16.0 + - uses: taiki-e/install-action@4cef1412cce204788f482e778a0b9187f9626a29 # v2.87.21 + with: + tool: cargo-zigbuild@0.23.4 + - run: cargo zigbuild --release --target "$TARGET" + - name: Check the binary is static + run: | + info=$(file "target/$TARGET/release/gh-img-server") + echo "$info" + grep -Eq 'statically linked|static-pie linked' <<<"$info" + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: gh-img-server-${{ env.TARGET }} + path: target/${{ env.TARGET }}/release/gh-img-server + retention-days: 7 + if-no-files-found: error From 21e3d42ca0ebbdb94b47a413760e14dddc09cd83 Mon Sep 17 00:00:00 2001 From: jamie Date: Sun, 27 Sep 2026 12:14:31 +0100 Subject: [PATCH 2/2] ci: turn off the uv cache --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c72bd9..ef6b0dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,9 @@ jobs: - run: shellcheck bin/gh-img scripts/*.sh deploy/install.sh - run: sudo apt-get update -q && sudo apt-get install -y -q libimage-exiftool-perl - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 + with: + # no lockfile to key the cache on + enable-cache: false - run: scripts/check-fixtures.sh build: