-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from tuist/continuous-integration
feat: set up continuous integration
- Loading branch information
Showing
22 changed files
with
254 additions
and
15 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,111 @@ | ||
name: Apple Bundle Size Analyzer | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: {} | ||
|
||
env: | ||
TUIST_CONFIG_TOKEN: ${{ secrets.TUIST_CONFIG_CLOUD_TOKEN }} | ||
|
||
concurrency: | ||
group: apple-bundle-size-analyzer-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: "Release build on ${{ matrix.os }}" | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
swift: ["5.10"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: SwiftyLab/setup-swift@latest | ||
with: | ||
swift-version: ${{ matrix.swift }} | ||
- uses: jdx/mise-action@v2 | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
with: | ||
experimental: true | ||
- name: Run | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
run: mise run build-spm | ||
- name: Run | ||
if: runner.os == 'Windows' | ||
run: swift build --product AppleBundleSizeAnalyzer | ||
|
||
build_tuist: | ||
name: "Tuist build" | ||
timeout-minutes: 10 | ||
runs-on: "macos-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Select Xcode | ||
run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app | ||
- uses: jdx/mise-action@v2 | ||
with: | ||
experimental: true | ||
- name: Run | ||
run: | | ||
mise x -- tuist install | ||
mise run build | ||
test: | ||
name: "Test on ${{ matrix.os }}" | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
os: [macos-latest] | ||
swift: ["5.10"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Select Xcode | ||
run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app | ||
- uses: SwiftyLab/setup-swift@latest | ||
with: | ||
swift-version: ${{ matrix.swift }} | ||
- uses: jdx/mise-action@v2 | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
with: | ||
experimental: true | ||
- name: Run | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
run: mise run test-spm | ||
- name: Run | ||
if: runner.os == 'Windows' | ||
run: swift test | ||
|
||
test_tuist: | ||
name: "Tuist test" | ||
timeout-minutes: 10 | ||
runs-on: "macos-latest" | ||
env: | ||
TUIST_CONFIG_TOKEN: ${{ secrets.TUIST_CONFIG_CLOUD_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Select Xcode | ||
run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app | ||
- uses: jdx/mise-action@v2 | ||
with: | ||
experimental: true | ||
- name: Run | ||
run: | | ||
mise x -- tuist install | ||
mise run test | ||
lint: | ||
name: Lint | ||
timeout-minutes: 10 | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: jdx/mise-action@v2 | ||
with: | ||
experimental: true | ||
- name: Run | ||
run: mise run lint |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
# mise description="Build the project using Tuist" | ||
set -euo pipefail | ||
|
||
tuist build --path $MISE_PROJECT_ROOT |
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,10 @@ | ||
#!/bin/bash | ||
# mise description="Builds the project using Swift Package Manager in Linux" | ||
set -euo pipefail | ||
|
||
docker run --rm \ | ||
--volume "$MISE_PROJECT_ROOT:/package" \ | ||
--workdir "/package" \ | ||
swiftlang/swift:nightly-5.10-focal \ | ||
/bin/bash -c \ | ||
"swift build --product AppleBundleSizeAnalyzer --build-path ./.build/linux" |
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,5 @@ | ||
#!/bin/bash | ||
# mise description="Build the project using Swift Package Manager" | ||
set -euo pipefail | ||
|
||
swift build --product AppleBundleSizeAnalyzer --package-path $MISE_PROJECT_ROOT --configuration release |
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,5 @@ | ||
#!/bin/bash | ||
# mise description="Cache the dependencies using Tuist" | ||
set -euo pipefail | ||
|
||
tuist cache --path $MISE_PROJECT_ROOT |
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,6 @@ | ||
#!/bin/bash | ||
# mise description="Lint the project using SwiftLint and SwiftFormat" | ||
set -euo pipefail | ||
|
||
swiftformat $MISE_PROJECT_ROOT --lint | ||
swiftlint lint --quiet --config $MISE_PROJECT_ROOT/.swiftlint.yml $MISE_PROJECT_ROOT/Sources |
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,6 @@ | ||
#!/bin/bash | ||
# mise description="Lint the project using SwiftLint and SwiftFormat fixing the issues" | ||
set -euo pipefail | ||
|
||
swiftformat $MISE_PROJECT_ROOT | ||
swiftlint lint --fix --quiet --config $MISE_PROJECT_ROOT/.swiftlint.yml $MISE_PROJECT_ROOT/Sources |
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,5 @@ | ||
#!/bin/bash | ||
# mise description="Test the project using Tuist" | ||
set -euo pipefail | ||
|
||
tuist test AppleBundleSizeAnalyzer --path $MISE_PROJECT_ROOT |
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,10 @@ | ||
#!/bin/bash | ||
# mise description="Builds the project using Swift Package Manager in Linux" | ||
set -euo pipefail | ||
|
||
docker run --rm \ | ||
--volume "$MISE_PROJECT_ROOT:/package" \ | ||
--workdir "/package" \ | ||
swiftlang/swift:nightly-5.10-focal \ | ||
/bin/bash -c \ | ||
"swift test --build-path ./.build/linux" |
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,6 @@ | ||
#!/bin/bash | ||
# mise description="Test the project using Swift Package Manager" | ||
|
||
set -euo pipefail | ||
|
||
swift test --package-path $MISE_PROJECT_ROOT |
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,42 @@ | ||
# file options | ||
|
||
--symlinks ignore | ||
--disable hoistAwait | ||
--disable hoistTry | ||
--swiftversion 5.7 | ||
|
||
# format options | ||
|
||
--allman false | ||
--binarygrouping 4,8 | ||
--closingparen balanced | ||
--commas always | ||
--comments indent | ||
--decimalgrouping 3,6 | ||
--elseposition same-line | ||
--empty void | ||
--exponentcase lowercase | ||
--exponentgrouping disabled | ||
--extensionacl on-declarations | ||
--fractiongrouping disabled | ||
--header strip | ||
--hexgrouping 4,8 | ||
--hexliteralcase uppercase | ||
--ifdef indent | ||
--indent 4 | ||
--indentcase false | ||
--importgrouping testable-bottom | ||
--linebreaks lf | ||
--octalgrouping 4,8 | ||
--operatorfunc spaced | ||
--patternlet hoist | ||
--ranges spaced | ||
--self remove | ||
--semicolons inline | ||
--stripunusedargs always | ||
--trimwhitespace always | ||
--maxwidth 130 | ||
--wraparguments before-first | ||
--wrapcollections before-first | ||
--wrapconditions after-first | ||
--wrapparameters before-first |
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,24 @@ | ||
disabled_rules: | ||
- trailing_whitespace | ||
- trailing_comma | ||
- nesting | ||
- cyclomatic_complexity | ||
- file_length | ||
- todo | ||
- function_parameter_count | ||
- opening_brace | ||
- line_length | ||
identifier_name: | ||
min_length: | ||
error: 1 | ||
warning: 1 | ||
max_length: | ||
warning: 60 | ||
error: 80 | ||
inclusive_language: | ||
override_allowed_terms: | ||
- masterKey | ||
type_name: | ||
min_length: | ||
error: 1 | ||
warning: 1 |
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 @@ | ||
15.4 |
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
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 @@ | ||
|
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,9 +1,9 @@ | ||
import ProjectDescription | ||
|
||
let config = Config( | ||
// Create an account with "tuist auth" and a project with "tuist project create" | ||
// Create an account with "tuist auth" and a project with "tuist project create" | ||
// then uncomment the section below and set the project full-handle. | ||
// * Read more: https://docs.tuist.io/guides/quick-start/gather-insights | ||
// | ||
// fullHandle: "{account_handle}/{project_handle}", | ||
fullHandle: "tuist/apple-bundle-size-analyzer" | ||
) |
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
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