Files
thatguygriffandClaude Opus 5 f2b8f5a931
Tests / test (push) Successful in 46s
Check out without actions/checkout in CI
actions/checkout is a JavaScript action and the swift image has no node, so
the first run failed at exec: "node": executable file not found before any
Swift step ran. Replaced with a plain git fetch of the SHA, falling back to
the ref for servers without allowAnySHA1InWant.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01C5X1tYo9oxAfvoiFMh1QQr
2026-08-08 20:28:29 -03:00

45 lines
1.4 KiB
YAML

name: Tests
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
container:
# Pinned rather than tracking latest: a toolchain bump should be a commit,
# not a surprise on an unrelated push.
image: swift:6.2
steps:
# Checked out by hand rather than with actions/checkout, which is a
# JavaScript action — it needs `node` in the container, and the Swift
# image has no reason to ship one.
- name: Checkout
env:
GITEA_TOKEN: ${{ github.token }}
run: |
set -eu
git init -q .
git config --local http.extraheader \
"Authorization: Basic $(printf 'x-access-token:%s' "$GITEA_TOKEN" | base64 -w0)"
git remote add origin "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git"
# Fetching the exact SHA needs uploadpack.allowAnySHA1InWant on the
# server; fall back to the ref, which every server allows.
git fetch --depth 1 origin "$GITHUB_SHA" \
|| git fetch --depth 1 origin "$GITHUB_REF"
git checkout -q FETCH_HEAD
- name: Toolchain
run: swift --version
# This only covers IPodSyncKit — the format logic, which is where every
# test lives. The Contacts and EventKit readers are compiled out on Linux
# and can only be exercised on a Mac.
- name: Build
run: swift build --build-tests
- name: Test
run: swift test