Skip to content

Commit

Permalink
Update CI (#89)
Browse files Browse the repository at this point in the history
* Add Xcode 15.4 to the test matrix

* Update actions

* Support building binary using workflow_dispatch

* Compile snapshots as part of CI checks
  • Loading branch information
liamnichols committed May 28, 2024
1 parent 865b0fc commit e967224
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
13 changes: 13 additions & 0 deletions .github/scripts/compile-snapshots.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

echo "Swift Version:"
xcrun swift --version
echo ""

for snapshot in Tests/XCStringsToolTests/__Snapshots__/**/*.swift; do
echo "Compiling ‘$(basename $snapshot)"

if xcrun swiftc "$snapshot" -package-name "MyPackage" -o /dev/null ; then
echo " Success"
fi
done
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: "Build"

on:
workflow_call: {}
workflow_dispatch: {}
push:
branches:
- main
Expand All @@ -14,7 +15,7 @@ jobs:
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build Package
run: |-
Expand Down Expand Up @@ -69,7 +70,7 @@ jobs:
checksum=$(shasum -a 256 "$zip_path" | awk '{ print $1 }')
echo "checksum=$checksum" >> $GITHUB_ENV
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload Artifact Bundle
with:
name: xcstrings-tool.artifactbundle.zip
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,43 @@ jobs:
name: Validate SPI Manifest
runs-on: macos-14
env:
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.3.app/Contents/Developer
VALIDATE_SPI_MANIFEST: YES
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Validate SPI Manifest
run: swift package plugin validate-spi-manifest
compile-snapshots:
name: Compile Snapshots
runs-on: macos-14
env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Compile Snapshots
run: .github/scripts/compile-snapshots.sh
unit-test:
name: Unit Tests (Xcode ${{ matrix.xcode }})
strategy:
fail-fast: false
matrix:
xcode: ["15.0", "15.2", "15.3"]
xcode: ["15.0", "15.2", "15.3", "15.4"]
include:
- xcode: "15.0"
macos: macOS-13
- xcode: "15.2"
macos: macOS-14
- xcode: "15.3"
macos: macOS-14
- xcode: "15.4"
macos: macOS-14
runs-on: ${{ matrix.macos }}
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run Tests
run: xcodebuild clean test -scheme XCStringsTool-Package -destination platform=macOS

0 comments on commit e967224

Please sign in to comment.