generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 3
chore: Add GitHub workflow for tests, formatting, linting #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f4af179
chore: Add GitHub workflow for tests, linting, and codeQL
limhjgrace ffd0206
fix: Move workflow files into workflow subdirectory
limhjgrace 33b132e
chore: Add Makefile and update dependencies
limhjgrace ca2930d
fix: Fix ResourceExtension dependency import
limhjgrace 7e37834
fix: Remove unused URLSessionInstrumentation dependency
limhjgrace cc84709
fix: Execute addPlatformSpecific() method
limhjgrace 8881c2b
fix: Fix indent formatting in Makefile
limhjgrace c4f2ca0
chore: Remove linux tests, remove CodeQL, remove unused imports
limhjgrace 9d42693
fix: Fix test package dir name in github workflow
limhjgrace 38a0504
fix: Fix typo in package name
limhjgrace f01b87f
fix: Run SwiftFormat on all commits in a PR
limhjgrace File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,68 @@ | ||
| name: Build and Test | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| FormattingLint: | ||
| runs-on: macos-15 | ||
| steps: | ||
| - uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0 | ||
| - name: SwiftFormat | ||
| run: | | ||
| base_branch="${{ github.base_ref }}" | ||
| echo "swiftformat --lint $(git diff --name-only origin/$base_branch...HEAD) --reporter github-actions-log" | ||
|
|
||
| SwiftLint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0 | ||
| - name: GitHub Action for SwiftLint (Only files changed in the PR) | ||
| uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # 3.2.1 | ||
| env: | ||
| args: --strict | ||
| DIFF_BASE: ${{ github.base_ref }} | ||
| macOS: | ||
| runs-on: macos-15 | ||
| steps: | ||
| - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | ||
| - name: Build and Test for macOS | ||
| run: swift test --enable-code-coverage | ||
| - name: Upload Code coverage | ||
| run: | | ||
| curl -Os https://uploader.codecov.io/latest/macos/codecov | ||
| chmod +x codecov | ||
| xcrun llvm-cov export -ignore-filename-regex="pb\.swift|grpc\.swift" -format="lcov" .build/debug/aws-otel-swiftPackageTests.xctest/Contents/MacOS/aws-otel-swiftPackageTests -instr-profile .build/debug/codecov/default.profdata > .build/debug/codecov/coverage_report.lcov | ||
| ./codecov -f .build/debug/codecov/coverage_report.lcov | ||
| iOS: | ||
| runs-on: macos-15 | ||
| steps: | ||
| - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | ||
| - name: Install Homebrew kegs | ||
| run: make setup-brew | ||
| - name: Build for iOS | ||
| run: make build-for-testing-ios | ||
| - name: Test for iOS | ||
| run: make test-without-building-ios | ||
| tvOS: | ||
| runs-on: macos-15 | ||
| steps: | ||
| - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | ||
| - name: Install Homebrew kegs | ||
| run: make setup-brew | ||
| - name: Build for tvOS | ||
| run: make build-for-testing-tvos | ||
| - name: Test for tvOS | ||
| run: make test-without-building-tvos | ||
| watchOS: | ||
| runs-on: macos-15 | ||
| steps: | ||
| - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | ||
| - name: Install Homebrew kegs | ||
| run: make setup-brew | ||
| - name: Build for watchOS | ||
| run: make build-for-testing-watchos | ||
| - name: Test for watchOS | ||
| run: make test-without-building-watchos |
This file contains hidden or 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,77 @@ | ||
| PROJECT_NAME="aws-otel-swift-Package" | ||
|
|
||
| XCODEBUILD_OPTIONS_IOS=\ | ||
| -configuration Debug \ | ||
| -destination platform='iOS Simulator,name=iPhone 16,OS=18.0' \ | ||
| -scheme $(PROJECT_NAME) \ | ||
| -test-iterations 5 \ | ||
| -retry-tests-on-failure \ | ||
| -workspace . | ||
|
|
||
| XCODEBUILD_OPTIONS_TVOS=\ | ||
| -configuration Debug \ | ||
| -destination platform='tvOS Simulator,name=Apple TV 4K (3rd generation),OS=18.0' \ | ||
| -scheme $(PROJECT_NAME) \ | ||
| -test-iterations 5 \ | ||
| -retry-tests-on-failure \ | ||
| -workspace . | ||
|
|
||
| XCODEBUILD_OPTIONS_WATCHOS=\ | ||
| -configuration Debug \ | ||
| -destination platform='watchOS Simulator,name=Apple Watch Series 10 (46mm),OS=11.0' \ | ||
| -scheme $(PROJECT_NAME) \ | ||
| -test-iterations 5 \ | ||
| -retry-tests-on-failure \ | ||
| -workspace . | ||
|
|
||
| .PHONY: setup-brew | ||
| setup-brew: | ||
| brew update && brew install xcbeautify | ||
|
|
||
| .PHONY: build-ios | ||
| build-ios: | ||
| set -o pipefail && xcodebuild $(XCODEBUILD_OPTIONS_IOS) build | xcbeautify | ||
|
|
||
| .PHONY: build-tvos | ||
| build-tvos: | ||
| set -o pipefail && xcodebuild $(XCODEBUILD_OPTIONS_TVOS) build | xcbeautify | ||
|
|
||
| .PHONY: build-watchos | ||
| build-watchos: | ||
| set -o pipefail && xcodebuild $(XCODEBUILD_OPTIONS_IOS) build | xcbeautify | ||
|
|
||
| .PHONY: build-for-testing-ios | ||
| build-for-testing-ios: | ||
| set -o pipefail && xcodebuild $(XCODEBUILD_OPTIONS_IOS) build-for-testing | xcbeautify | ||
|
|
||
| .PHONY: build-for-testing-tvos | ||
| build-for-testing-tvos: | ||
| set -o pipefail && xcodebuild $(XCODEBUILD_OPTIONS_TVOS) build-for-testing | xcbeautify | ||
|
|
||
| .PHONY: build-for-testing-watchos | ||
| build-for-testing-watchos: | ||
| set -o pipefail && xcodebuild OTHER_LDFLAGS="$(OTHER_LDFLAGS) -fprofile-instr-generate" $(XCODEBUILD_OPTIONS_WATCHOS) build-for-testing | xcbeautify | ||
|
|
||
| .PHONY: test-ios | ||
| test-ios: | ||
| set -o pipefail && xcodebuild $(XCODEBUILD_OPTIONS_IOS) test | xcbeautify | ||
|
|
||
| .PHONY: test-tvos | ||
| test-tvos: | ||
| set -o pipefail && xcodebuild $(XCODEBUILD_OPTIONS_TVOS) test | xcbeautify | ||
|
|
||
| .PHONY: test-watchos | ||
| test-watchos: | ||
| set -o pipefail && xcodebuild $(XCODEBUILD_OPTIONS_WATCHOS) test | xcbeautify | ||
|
|
||
| .PHONY: test-without-building-ios | ||
| test-without-building-ios: | ||
| set -o pipefail && xcodebuild $(XCODEBUILD_OPTIONS_IOS) test-without-building | xcbeautify | ||
|
|
||
| .PHONY: test-without-building-tvos | ||
| test-without-building-tvos: | ||
| set -o pipefail && xcodebuild $(XCODEBUILD_OPTIONS_TVOS) test-without-building | xcbeautify | ||
|
|
||
| .PHONY: test-without-building-watchos | ||
| test-without-building-watchos: | ||
| set -o pipefail && xcodebuild $(XCODEBUILD_OPTIONS_WATCHOS) test-without-building | xcbeautify |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.