Skip to content

Commit 719d878

Browse files
committed
Add CI, Fix Lint Issues
1 parent 729e958 commit 719d878

File tree

15 files changed

+257
-13
lines changed

15 files changed

+257
-13
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: 🐞 Bug report
2+
description: Something is not working as expected.
3+
title: 🐞 <bug title>
4+
labels: bug
5+
6+
body:
7+
- type: textarea
8+
attributes:
9+
label: Description
10+
placeholder: >-
11+
A clear and concise description of what the bug is...
12+
validations:
13+
required: true
14+
15+
- type: textarea
16+
attributes:
17+
label: To Reproduce
18+
description: >-
19+
Steps to reliably reproduce the behavior.
20+
placeholder: |
21+
1. Go to '...'
22+
2. Click on '....'
23+
3. Scroll down to '....'
24+
4. See error
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
attributes:
30+
label: Expected Behavior
31+
placeholder: >-
32+
A clear and concise description of what you expected to happen...
33+
validations:
34+
required: true
35+
36+
- type: textarea
37+
attributes:
38+
label: Version Information
39+
description: >-
40+
click on the version number on the welcome screen
41+
value: |
42+
AboutWindow: [e.g. 0.x.y]
43+
macOS: [e.g. 13.2.1]
44+
Xcode: [e.g. 14.2]
45+
46+
- type: textarea
47+
attributes:
48+
label: Additional Context
49+
placeholder: >-
50+
Any other context or considerations about the bug...
51+
52+
- type: textarea
53+
attributes:
54+
label: Screenshots
55+
placeholder: >-
56+
If applicable, please provide relevant screenshots or screen recordings...
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: ✨ Feature request
2+
description: Suggest an idea for this project
3+
title: ✨ <feature title>
4+
labels: enhancement
5+
6+
body:
7+
- type: textarea
8+
attributes:
9+
label: Description
10+
placeholder: >-
11+
A clear and concise description of what you would like to happen...
12+
validations:
13+
required: true
14+
15+
- type: textarea
16+
attributes:
17+
label: Alternatives Considered
18+
placeholder: >-
19+
Any alternative solutions or features you've considered...
20+
21+
- type: textarea
22+
attributes:
23+
label: Additional Context
24+
placeholder: >-
25+
Any other context or considerations about the feature request...
26+
27+
- type: textarea
28+
attributes:
29+
label: Screenshots
30+
placeholder: >-
31+
If applicable, please provide relevant screenshots or screen recordings...

.github/scripts/build-docc.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
export LC_CTYPE=en_US.UTF-8
4+
5+
set -o pipefail && xcodebuild clean docbuild -scheme AboutWindow \
6+
-destination generic/platform=macos \
7+
-skipPackagePluginValidation \
8+
OTHER_DOCC_FLAGS="--transform-for-static-hosting --hosting-base-path WelcomeWindow --output-path ./docs" | xcpretty

.github/scripts/tests.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
ARCH=""
4+
5+
if [ $1 = "arm" ]
6+
then
7+
ARCH="arm64"
8+
else
9+
ARCH="x86_64"
10+
fi
11+
12+
echo "Building with arch: ${ARCH}"
13+
14+
export LC_CTYPE=en_US.UTF-8
15+
16+
set -o pipefail && arch -"${ARCH}" xcodebuild \
17+
-scheme AboutWindow \
18+
-derivedDataPath ".build" \
19+
-destination "platform=macOS,arch=${ARCH},name=My Mac" \
20+
-skipPackagePluginValidation \
21+
clean test | xcpretty
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CI - Pull Request
2+
on:
3+
pull_request:
4+
branches:
5+
- 'main'
6+
workflow_dispatch:
7+
jobs:
8+
swiftlint:
9+
name: SwiftLint
10+
uses: ./.github/workflows/swiftlint.yml
11+
secrets: inherit
12+
test:
13+
name: Testing AboutWindow
14+
needs: swiftlint
15+
uses: ./.github/workflows/tests.yml
16+
secrets: inherit

.github/workflows/CI-push.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: CI - Push to main
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
workflow_dispatch:
7+
jobs:
8+
swiftlint:
9+
name: SwiftLint
10+
uses: ./.github/workflows/swiftlint.yml
11+
secrets: inherit
12+
test:
13+
name: Testing AboutWindow
14+
needs: swiftlint
15+
uses: ./.github/workflows/tests.yml
16+
secrets: inherit
17+
build_documentation:
18+
name: Build Documentation
19+
needs: [swiftlint, test]
20+
uses: ./.github/workflows/build-documentation.yml
21+
secrets: inherit
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: build-documentation
2+
on:
3+
workflow_dispatch:
4+
workflow_call:
5+
jobs:
6+
build-docc:
7+
runs-on: [self-hosted, macOS]
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@v3
11+
- name: Build Documentation
12+
run: exec ./.github/scripts/build-docc.sh
13+
- name: Init new repo in dist folder and commit generated files
14+
run: |
15+
cd docs
16+
git init
17+
git config http.postBuffer 524288000
18+
git add -A
19+
git config --local user.email "[email protected]"
20+
git config --local user.name "GitHub Action"
21+
git commit -m 'deploy'
22+
23+
- name: Force push to destination branch
24+
uses: ad-m/[email protected]
25+
with:
26+
github_token: ${{ secrets.GITHUB_TOKEN }}
27+
branch: docs
28+
force: true
29+
directory: ./docs
30+
31+
############################
32+
##### IMPORTANT NOTICE #####
33+
############################
34+
# This was used to build the documentation catalog until
35+
# it didn't produce the 'documentation' directory anymore.
36+
#
37+
# - uses: fwcd/[email protected]
38+
# with:
39+
# target: CodeEditTextView
40+
# output: ./docs
41+
# hosting-base-path: CodeEditTextView
42+
# disable-indexing: 'true'
43+
# transform-for-static-hosting: 'true'
44+
#
45+
# The command that this plugin uses is:
46+
#
47+
# swift package --allow-writing-to-directory ./docs generate-documentation \
48+
# --target CodeEditTextView
49+
# --output-path ./docs
50+
# --hosting-base-path CodeEditTextView
51+
# --disable-indexing
52+
# --transform-for-static-hosting
53+
#
54+
# We now use xcodebuild to build the documentation catalog instead.
55+
#

.github/workflows/swiftlint.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: SwiftLint
2+
on:
3+
workflow_dispatch:
4+
workflow_call:
5+
jobs:
6+
SwiftLint:
7+
runs-on: [self-hosted, macOS]
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: GitHub Action for SwiftLint with --strict
11+
run: swiftlint --reporter github-actions-logging --strict

.github/workflows/tests.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: tests
2+
on:
3+
workflow_dispatch:
4+
workflow_call:
5+
jobs:
6+
code-edit-text-view-tests:
7+
name: Testing AboutWindow
8+
runs-on: [self-hosted, macOS]
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v3
12+
- name: Testing Package
13+
run: exec ./.github/scripts/tests.sh arm

Example/AboutWindowExample/Views/Contributors/ContributorsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct ContributorsView: View {
2121
.opacity(0.5)
2222
}
2323
}
24-
24+
2525
}
2626
}
2727
}

0 commit comments

Comments
 (0)