docs: add documentation action #24
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: AptosKit Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-and-test: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Xcode | |
uses: maxim-lobanov/setup-xcode@v1 | |
- name: Build and test | |
run: | | |
TEST_OUTPUT=$(xcodebuild clean build test \ | |
-scheme AptosKit \ | |
-sdk macosx15.0 \ | |
-destination 'platform=macOS,arch=arm64' \ | |
-enableCodeCoverage YES | tee xcodebuild.log) | |
# Extract the .xcresult path from the output | |
XCRESULT_PATH=$(echo "$TEST_OUTPUT" | grep -oE '/Users/[^\"]+\.xcresult') | |
# Create a directory for the output results | |
mkdir -p output | |
# Copy the .xcresult file to the output directory | |
cp -R "$XCRESULT_PATH" output/ | |
# Copy the xcodebuild log file as well | |
cp xcodebuild.log output/ | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: xcresult-files | |
path: output/ |