diff --git a/.github/workflows/test15.yml b/.github/workflows/test15.yml new file mode 100644 index 0000000..2f7f1c2 --- /dev/null +++ b/.github/workflows/test15.yml @@ -0,0 +1,64 @@ +name: Update and Build FuseMFS + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + update-and-build: + runs-on: macos-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Xcode + run: | + sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer + sudo xcodebuild -license accept + + - name: Install dependencies + run: | + brew update + brew install cmake + + - name: Update Xcode project settings + run: | + # Get the list of configuration IDs + CONFIG_IDS=$(plutil -extract objects json -o - FuseMFS.xcodeproj/project.pbxproj | jq -r 'to_entries[] | select(.value.isa == "XCBuildConfiguration") | .key') + + # Iterate over each configuration ID and update the settings + for CONFIG_ID in $CONFIG_IDS; do + /usr/libexec/PlistBuddy -c "Set :objects:$CONFIG_ID:buildSettings:SDKROOT macosx" FuseMFS.xcodeproj/project.pbxproj || true + /usr/libexec/PlistBuddy -c "Set :objects:$CONFIG_ID:buildSettings:ARCHS '$(ARCHS_STANDARD_64_BIT)'" FuseMFS.xcodeproj/project.pbxproj || true + /usr/libexec/PlistBuddy -c "Set :objects:$CONFIG_ID:buildSettings:VALID_ARCHS 'arm64 x86_64'" FuseMFS.xcodeproj/project.pbxproj || true + /usr/libexec/PlistBuddy -c "Set :objects:$CONFIG_ID:buildSettings:ONLY_ACTIVE_ARCH YES" FuseMFS.xcodeproj/project.pbxproj || true + done + + - name: Validate project file + run: | + plutil -lint FuseMFS.xcodeproj/project.pbxproj + if [ $? -ne 0 ]; then + echo "project.pbxproj is invalid" + exit 1 + fi + + - name: Build Xcode project for arm64 + run: | + xcodebuild -project FuseMFS.xcodeproj -scheme fusemfs -configuration Release -arch arm64 build + + - name: Build Xcode project for x86_64 + run: | + xcodebuild -project FuseMFS.xcodeproj -scheme fusemfs -configuration Release -arch x86_64 build + + - name: Run Tests for arm64 + run: | + xcodebuild test -project FuseMFS.xcodeproj -scheme fusemfs -configuration Debug -destination 'platform=macOS,arch=arm64' + + - name: Run Tests for x86_64 + run: | + xcodebuild test -project FuseMFS.xcodeproj -scheme fusemfs -configuration Debug -destination 'platform=macOS,arch=x86_64'