Create test19.yml #1
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: test19 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
update-and-build: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: true # This ensures that submodules are cloned | |
- name: Verify files exist | |
run: | | |
if [ ! -f "libmfs/mfs.c" ]; then | |
echo "Error: libmfs/mfs.c not found" | |
exit 1 | |
fi | |
if [ ! -f "libres/res.c" ]; then | |
echo "Error: libres/res.c not found" | |
exit 1 | |
fi | |
- 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: Print first few lines of project.pbxproj (before modification) | |
run: | | |
head -n 10 FuseMFS.xcodeproj/project.pbxproj | |
- name: Display hidden characters in project.pbxproj (before modification) | |
run: | | |
cat -vET FuseMFS.xcodeproj/project.pbxproj | head -n 10 | |
- name: Update Xcode project settings | |
run: | | |
# Update SDKROOT to the latest macOS SDK | |
sed -i '' 's/SDKROOT = macosx[0-9.]*/SDKROOT = macosx;/g' FuseMFS.xcodeproj/project.pbxproj | |
# Update ARCHS to use 64-bit standard architectures | |
sed -i '' 's/ARCHS = .*/ARCHS = "$(ARCHS_STANDARD_64_BIT)";/g' FuseMFS.xcodeproj/project.pbxproj | |
# Update VALID_ARCHS to include only arm64 and x86_64 | |
sed -i '' 's/VALID_ARCHS = .*/VALID_ARCHS = "arm64 x86_64";/g' FuseMFS.xcodeproj/project.pbxproj | |
# Ensure ONLY_ACTIVE_ARCH is set to YES | |
sed -i '' 's/ONLY_ACTIVE_ARCH = .*/ONLY_ACTIVE_ARCH = YES;/g' FuseMFS.xcodeproj/project.pbxproj | |
- name: Print first few lines of project.pbxproj (after modification) | |
run: | | |
head -n 10 FuseMFS.xcodeproj/project.pbxproj | |
- name: Display hidden characters in project.pbxproj (after modification) | |
run: | | |
cat -vET FuseMFS.xcodeproj/project.pbxproj | head -n 10 | |
- 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' |