Skip to content
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

feat: release 3.7.0 #273

Merged
merged 21 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,7 @@ Standard: Auto
StatementMacros:
- GrowingMod
- GrowingService
- GrowingPropertyDefine
- GrowingSafeStringPropertyImplementation
TabWidth: 4
UseTab: Never
88 changes: 0 additions & 88 deletions .github/workflows/SonarCloud.yml

This file was deleted.

74 changes: 52 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: macos-latest
env:
DERIVED_DATA: $HOME/.DerivedData

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Force Xcode 13.4.1
run: sudo xcode-select -switch /Applications/Xcode_13.4.1.app
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v2

- name: Cache cocoapods
uses: actions/cache@v3
Expand All @@ -36,17 +30,53 @@ jobs:
${{ runner.os }}-pods-

- name: Pod Install
run: |
pod install
run: cd Example && pod install && cd ..

- name: Run Logic Tests
- name: Run tests to generate coverage statistics # https://sonarsource.atlassian.net/browse/CPP-3987
run: |
xcodebuild test -workspace GrowingAnalytics.xcworkspace \
mkdir -p ${{ env.DERIVED_DATA }}
xcodebuild test -workspace Example/GrowingAnalytics.xcworkspace \
-scheme GrowingAnalyticsTests \
-testPlan GrowingAnalyticsTests \
-destination 'platform=iOS Simulator,name=iPhone 13' \
-enableCodeCoverage YES
-destination 'platform=iOS Simulator,name=iPhone 14' \
-enableCodeCoverage YES \
-derivedDataPath ${{ env.DERIVED_DATA }} \
OTHER_CFLAGS="\$(inherited) -gen-cdb-fragment-path ${{ env.DERIVED_DATA }}/compilation-database"
pushd ${{ env.DERIVED_DATA }}/compilation-database
sed -e '1s/^/[\'$'\n''/' -e '$s/,$/\'$'\n'']/' *.json > ${{ env.DERIVED_DATA }}/compile_commands.json
popd

- name: Brew Install Xcresultparser
run: |
brew tap a7ex/homebrew-formulae
brew install xcresultparser

- name: Parse xcresult to Cobertura xml
run: |
xcresultparser -o cobertura ${{ env.DERIVED_DATA }}/Logs/Test/*.xcresult/ \
> ${{ env.DERIVED_DATA }}/cobertura-coverage.xml
pwd

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: /Users/runner/.DerivedData/cobertura-coverage.xml

- name: Parse xcresult to Sonarqube xml
run: |
xcresultparser -c -o xml ${{ env.DERIVED_DATA }}/Logs/Test/*.xcresult/ \
> ${{ env.DERIVED_DATA }}/sonar-coverage.xml

- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner \
-Dsonar.cfamily.compile-commands="${{ env.DERIVED_DATA }}/compile_commands.json" \
-Dsonar.coverageReportPaths="${{ env.DERIVED_DATA }}/sonar-coverage.xml"

- name: Upload coverage to Codecov
if: always()
run: bash <(curl -s https://codecov.io/bash)
# https://github.com/sonarsource-cfamily-examples/macos-xcode-coverage-gh-actions-sc/blob/main/.github/workflows/build.yml
# https://github.com/SonarSource/sonarcloud-github-c-cpp
11 changes: 7 additions & 4 deletions .github/workflows/code_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
code-format:
name: Code Format
runs-on: macos-latest
if: ${{ github.actor != 'GIOSDK' }} # 禁止套娃
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -24,8 +25,8 @@ jobs:
- name: Install clang-format
run: brew install clang-format

- name: Install swiftlint
run: swiftlint --version
- name: Install swiftformat
run: swiftformat --version

- name: Code Format
run: |
Expand All @@ -48,14 +49,16 @@ jobs:
\%^(Growing|Modules/|Services/).*\.swift% p
\%Package.swift% p
' \
| xargs swiftlint --fix
| xargs swiftformat

- name: Commit
run: |
if [[ $(git status) == *"nothing to commit"* ]]; then
echo "All Code formatted correctly."
else
git checkout ${{ github.head_ref }}
git config user.name GIOSDK
git config user.email [email protected]
git commit -am "style: code format"
git push --set-upstream origin ${{ github.head_ref }}
git push origin ${{ github.head_ref }}
fi
5 changes: 4 additions & 1 deletion .github/workflows/draft_release_with_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ jobs:

- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GIOSDK_PAT }}

- name: Conventional Changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.github_token}}
preset: 'angular'
skip-version-file: 'true'
skip-commit: 'true'
Expand All @@ -36,6 +37,8 @@ jobs:
if: ${{ steps.changelog.outputs.skipped == 'false' }}
run: |
sh ./scripts/update_version.sh ${{ steps.changelog.outputs.tag }}
git config user.name GIOSDK
git config user.email [email protected]
git commit -am "feat: release ${{ steps.changelog.outputs.tag }}"
git push
git tag -d ${{ steps.changelog.outputs.tag }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/draft_release_without_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ jobs:

- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GIOSDK_PAT }}

- name: Conventional Changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.github_token}}
preset: 'angular'
skip-version-file: 'true'
skip-commit: 'true'
Expand All @@ -36,6 +37,8 @@ jobs:
- name: Generate xcframework
if: ${{ steps.changelog.outputs.skipped == 'false' }}
run:
git config user.name GIOSDK
git config user.email [email protected]
sh ./scripts/generate_xcframework.sh releaseDefaultAutotracker --verbose

- name: Archive
Expand Down
9 changes: 9 additions & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 1
builder:
configs:
- platform: ios
scheme: GrowingAutotracker
- platform: macos-xcodebuild
scheme: GrowingTracker
- platform: macos-spm
target: GrowingTracker
9 changes: 9 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# https://github.com/nicklockwood/SwiftFormat/blob/main/.swiftformat

# file options

--exclude Modules/SwiftProtobuf/event_v3.pb.swift

# format options

--swiftversion 5
Loading