setup command #31
Workflow file for this run
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: Test | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [main] | |
env: | |
DESTINATION: platform=macOS,arch=arm64 | |
SCHEME: Cosmic | |
TEST_SCHEME: CosmicTests | |
XCODE_PATH: /Applications/Xcode_16.0.app/Contents/Developer | |
PKL_VERSION: 0.26.3 | |
PKL_ARCH: macos-aarch64 | |
jobs: | |
xcode_tests: | |
name: Xcode Tests | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pkl | |
run: | | |
curl -L -o pkl "https://github.com/apple/pkl/releases/download/${PKL_VERSION}/pkl-${PKL_ARCH}" | |
chmod +x pkl | |
sudo mv pkl /usr/local/bin/pkl | |
pkl --version | |
- name: Select Xcode version | |
run: sudo xcode-select -s "${XCODE_PATH}" | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/Library/Developer/Xcode/DerivedData/Cosmic-*/SourcePackages/ | |
~/Library/Caches/org.swift.swiftpm/ | |
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} | |
- name: Execute build | |
run: xcodebuild build -scheme "$SCHEME" -destination "$DESTINATION" CODE_SIGNING_ALLOWED='NO' | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Execute test | |
run: xcodebuild test -resultBundlePath TestResults -scheme "$TEST_SCHEME" -destination "$DESTINATION" CODE_SIGNING_ALLOWED='NO' | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Archive test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: TestResults.xcresult | |
path: TestResults.xcresult/ | |
functional_tests: | |
name: Functional Tests | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pkl | |
run: | | |
curl -L -o pkl "https://github.com/apple/pkl/releases/download/${PKL_VERSION}/pkl-${PKL_ARCH}" | |
chmod +x pkl | |
sudo mv pkl /usr/local/bin/pkl | |
pkl --version | |
- name: Select Xcode version | |
run: sudo xcode-select -s "${XCODE_PATH}" | |
- name: Build and archive Cosmic | |
run: | | |
xcodebuild archive -scheme "$SCHEME" -destination "$DESTINATION" CODE_SIGNING_ALLOWED='NO' -archivePath ./build/Cosmic.xcarchive | |
ls ./build | |
- name: Install Cosmic | |
run: | | |
sudo cp ./build/Cosmic.xcarchive/Products/usr/local/bin/cosmic /usr/local/bin/cosmic | |
cosmic --help | |
- name: Run setup subcommand | |
run: | | |
cosmic setup --verbose | |
echo "$HOME/Packages" >> $GITHUB_PATH | |
- name: Run add subcommand | |
run: | | |
cosmic add k9s --verbose | |
- name: Run installed package | |
run: | | |
k9s version --short |