From 5ab1cdcda790bd2f06a7ee852aed8782f2e54cfb Mon Sep 17 00:00:00 2001 From: Saagar Jha Date: Wed, 2 Nov 2022 02:39:27 -0700 Subject: [PATCH] Add a CI script --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 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..0c1205e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + pull_request: + branches: [master] + +jobs: + test: + runs-on: macos-12 + steps: + - uses: actions/checkout@v2 + + - name: Install xcodes + run: brew install robotsandpencils/made/xcodes + + - name: Download Xcode + run: xcodes download --directory "$PWD" 14.0.1 + + - name: Build unxip + run: swift build --configuration release + + - name: Run unxip + run: .build/release/unxip Xcode-14.0.1+14A400.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. + - name: Validate Xcode + run: diff -r Xcode.app /Applications/Xcode_14.0.1.app > diff || true; cat diff && ! test -s diff