Update libunxip failure handling to throw errors #58
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
paths: | |
- '*.swift' | |
- 'Makefile' | |
- '.github/workflows/*' | |
pull_request: | |
paths: | |
- '*.swift' | |
- 'Makefile' | |
- '.github/workflows/*' | |
branches: | |
- main | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [macos-13, ubuntu-22.04] | |
name: Test | |
runs-on: ${{ matrix.os }} | |
environment: ci | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: System Info | |
run: uname -a | |
- name: Install Swift | |
if: ${{ !startsWith( matrix.os, 'macos' ) }} | |
run: eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" && brew install swift | |
- name: Download Xcode | |
run: wget http://server.saagarjha.com/Xcode_15_beta.xip.encrypted | |
# I don't hate you, I just don't want to get sued | |
- name: Decrypt Xcode | |
env: | |
ENCRYPTION_KEY: ${{ secrets.ENCRYPTION_KEY }} | |
run: openssl enc -aes-256-cbc -d -pass 'env:ENCRYPTION_KEY' -in Xcode_15_beta.xip.encrypted > Xcode_15_beta.xip | |
- name: Build unxip | |
run: swift build --configuration release | |
- name: Run unxip | |
run: .build/release/unxip -s Xcode_15_beta.xip /tmp | grep -q 'Created 74201 files, 19130 directories, 7699 symlinks, and 16601 hardlinks' | |
- name: Run xip | |
if: ${{ startsWith( matrix.os, 'macos' ) }} | |
run: xip --expand Xcode_15_beta.xip | |
# diff on Monterey is gnudiff, which exits with EXIT_TROUBLE (2) if it | |
# finds problems. The Xcode bundle has a ruby symlink that is recursive, | |
# which trips this. So don't rely on the status, but instead use the | |
# output exclusively. Note that this means we need to test for existence | |
# ourselves! | |
- name: Validate Xcode | |
if: ${{ startsWith( matrix.os, 'macos' ) }} | |
run: diff -r /tmp/Xcode-beta.app Xcode-beta.app > diff || true; cat diff && ! test -s diff && test -d Xcode-beta.app |