-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create build workflow * add xcresulttool * change min deployment target * change min deployment target for tests * run build first * install pkl * correct cache * reduce test footprint for debug * save test artifacts * xcpretty and save on failure * select xcode ver * proper install pkl * proper install pkl * reenable xcresulttool * restore all tests * restore build step * improve tests and add lint * simplify xcode test args and add func tests * install pkl for functional tests
- Loading branch information
Showing
5 changed files
with
120 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Lint | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
lint: | ||
name: SwiftLint Linting | ||
runs-on: macos-14 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install SwiftLint | ||
run: | | ||
brew install swiftlint | ||
swiftlint version | ||
- name: Run SwiftLint | ||
run: swiftlint |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
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 Cosmic command | ||
run: | | ||
cosmic add k9s |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# .github/workflows/test.yml artifacts | ||
build/ | ||
TestResults.xcresult | ||
TestResults | ||
|
||
# macOS | ||
.DS_Store | ||
|
||
|
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
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