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