Skip to content

Commit

Permalink
Update GitHub Actions & Lint (#77)
Browse files Browse the repository at this point in the history
# Update GitHub Actions & Lint

## ♻️ Current situation & Problem
- There is no uniform setup for the YML files in this repo.

## ⚙️ Release Notes 
- Uniform setup and add a linter GitHub Action

### Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md).
  • Loading branch information
PSchmiedmayer authored Jun 14, 2024
1 parent 40522a2 commit 46fd6e7
Show file tree
Hide file tree
Showing 26 changed files with 758 additions and 575 deletions.
12 changes: 6 additions & 6 deletions .github/DISCUSSION_TEMPLATE/challenges-and-help.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ body:
id: reproduction
attributes:
label: Reproduction
description: |
description: |
Please provide a description of how to reproduce the problem you are facing.
If you are facing a problem in your application, please provide a link to a failing UI test or unit test to reproduce the issue.
If you face a build error or a problem with releasing your application, please link a GitHub Action run reproducing the error outside of your development.
placeholder: |
If you face a build error or a problem with releasing your application, please link a GitHub Action run reproducing the error.
placeholder: |
What steps did you follow to get the problem?
Provide links and steps on how to reproduce the problem.
validations:
Expand All @@ -58,14 +58,14 @@ body:
id: additionalcontext
attributes:
label: Additional context
description: |
description: |
Please provide any additional context that might be relevant to your setup problem.
placeholder: Any additional context that might be relevant to your problem.
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md)
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md) # yamllint disable-line rule:line-length
options:
- label: I agree to follow this projects's Code of Conduct and Contributing Guidelines
required: true
14 changes: 7 additions & 7 deletions .github/DISCUSSION_TEMPLATE/ideas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,26 @@ body:
attributes:
label: Alternatives considered
description: |
Please provide a clear and concise description of any alternative solutions or features you've considered.
Please provide a clear and concise description of any alternative solutions or features you've considered.
Is there already software that has the behavior you're interested in? What is it, and how does it work?
placeholder: |
A clear and concise description of any alternative solutions or features you've considered.
A clear and concise description of any alternative solutions or features you've considered.
Is there already software that has the behavior you're interested in? What is it, and how does it work?
validations:
required: true
- type: textarea
id: additionalcontext
attributes:
label: Additional context
description: Please provide any additional context that might be relevant for your feature report
placeholder: Any additional context that might be relevant for your feature report
description: Please provide any additional context that might be relevant for your feature report.
placeholder: Any additional context that might be relevant for your feature report.
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md)
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md) # yamllint disable-line rule:line-length
options:
- label: I agree to follow this projects's Code of Conduct and Contributing Guidelines
required: true
8 changes: 4 additions & 4 deletions .github/DISCUSSION_TEMPLATE/show-and-tell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body:
description: |
Please provide a description of your project and the software you have developed!
Share your background, motivation for your project, and additional scientific background.
Feel free to share screenshots, videos, and examples demonstrating your project.
placeholder: A descriptive overview of your project, including images, videos, and examples.
validations:
Expand All @@ -29,17 +29,17 @@ body:
id: contact
attributes:
label: Contact Information and Additional Context
description: |
description: |
Feel free to share some contact information and additional links to your project!
placeholder: |
placeholder: |
Your contact information and additional context.
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md)
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md) # yamllint disable-line rule:line-length
options:
- label: I agree to follow this projects's Code of Conduct and Contributing Guidelines
required: true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ body:
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md)
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md) # yamllint disable-line rule:line-length
options:
- label: I agree to follow this project's Code of Conduct and Contributing Guidelines
required: true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/internal_change.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ body:
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md)
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md) # yamllint disable-line rule:line-length
options:
- label: I agree to follow this project's Code of Conduct and Contributing Guidelines
required: true
10 changes: 7 additions & 3 deletions .github/ISSUE_TEMPLATE/major_feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ body:
id: alternatives
attributes:
label: Alternatives considered
description: Please provide a clear and concise description of any alternative solutions or features you've considered. Is there already software that has the behavior you're interested in? What is it, and how does it work?
placeholder: A clear and concise description of any alternative solutions or features you've considered. Is there already software that has the behavior you're interested in? What is it, and how does it work?
description: |
Please provide a clear and concise description of any alternative solutions or features you've considered.
Is there already software that has the behavior you're interested in? What is it, and how does it work?
placeholder: |
A clear and concise description of any alternative solutions or features you've considered.
Is there already software that has the behavior you're interested in? What is it, and how does it work?
validations:
required: true
- type: textarea
Expand All @@ -57,7 +61,7 @@ body:
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md)
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md) # yamllint disable-line rule:line-length
options:
- label: I agree to follow this project's Code of Conduct and Contributing Guidelines
required: true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/minor_feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ body:
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md)
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md) # yamllint disable-line rule:line-length
options:
- label: I agree to follow this project's Code of Conduct and Contributing Guidelines
required: true
16 changes: 8 additions & 8 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#

ignore:
- "Tests"
- "Example"
- "Tests"
- "Example"

codecov:
require_ci_to_pass: yes
require_ci_to_pass: true
bot: PaulsAutomationBot
branch: main

Expand All @@ -38,12 +38,12 @@ coverage:
parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no
conditional: true
loop: true
method: false
macro: false

comment:
layout: "reach,diff,flags,files,footer"
behavior: default
require_changes: no
require_changes: false
12 changes: 7 additions & 5 deletions .github/workflows/action-release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ on:
workflow_call:
inputs:
user:
description: 'Optional GitHub username that is associated with the GitHub Personal Access Token (PAT)'
description: |
Optional GitHub username that is associated with the GitHub Personal Access Token (PAT)
type: string
required: false
default: ''
secrets:
access-token:
description: 'GitHub Personal Access Token (PAT) if the default branch is protected and needs a specific access token to push tags to the branch'
description: |
GitHub Personal Access Token (PAT) if the default branch is protected and needs a specific access token to push tags to the branch
required: false

jobs:
Expand All @@ -44,12 +46,12 @@ jobs:
MINOR=${VERSION%.*}
echo "Push Tags $MAJOR and $MINOR for $VERSION"
git config user.name "${{ inputs.user || github.actor }}"
git config user.email "${{ inputs.user || github.actor }}@users.noreply.github.com"
git switch --detach ${VERSION}
git push origin :refs/tags/${MAJOR}
git tag -fa "${MAJOR}" -m "${MAJOR}"
git push origin --tags
Expand Down
100 changes: 55 additions & 45 deletions .github/workflows/archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,49 @@ on:
workflow_call:
inputs:
workspaceFile:
description: 'The path of the Xcode Workspace file (including the file extension).'
description: |
The path of the Xcode Workspace file (including the file extension).
type: string
required: true
xcArchiveName:
description: 'The name of the to be created XCArchive. It must not include the default XCArchive extension ".xcarchive" as the file naming is automatically done be the workflow.'
description: |
The name of the to be created XCArchive.
It must not include the default XCArchive extension ".xcarchive" as the file naming is automatically done be the workflow.
type: string
required: true
scheme:
description: 'The project scheme that should be used for the archiving process.'
description: |
The project scheme that should be used for the archiving process.
type: string
required: true
version:
description: 'The version number of the XCFramework embedded in the XCArchives.'
description: |
The version number of the XCFramework embedded in the XCArchives.
type: string
required: false
default: 'ci'
configuration:
description: 'The build configuration to use when archiving the scheme, either Debug or Release.'
description: |
The build configuration to use when archiving the scheme, either Debug or Release.
type: string
required: false
default: 'Release'
runsonlabels:
description: 'JSON-based collection of labels indicating which type of github runner should be chosen.'
description: |
JSON-based collection of labels indicating which type of github runner should be chosen.
type: string
required: false
default: '["macos-14"]'
sdk:
description: 'JSON-based collection of SDK for the exported framework. Defaults to all SDKs. You can list SDKs using `xcodebuild -showsdks`.'
description: |
JSON-based collection of SDK for the exported framework. Defaults to all SDKs.
You can list SDKs using `xcodebuild -showsdks`.
type: string
required: false
default: '["iphoneos", "iphonesimulator", "macosx", "appletvos", "appletvsimulator", "xros", "xrsimulator", "watchos", "watchsimulator"]'
cxxInterop:
description: 'Enable the compilation of the XCArchive with active Swift / C++ interoperability.'
description: |
Enable the compilation of the XCArchive with active Swift / C++ interoperability.
type: boolean
required: false
default: false
Expand All @@ -57,40 +67,40 @@ jobs:
matrix:
sdk: ${{ fromJson(inputs.sdk) }}
steps:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Check environment
run: |
xcodebuild -version
swift --version
echo Release version: ${{ inputs.version }}
echo SDK: ${{ matrix.sdk }}
- name: Install xcbeautify
if: ${{ !env.selfhosted && inputs.scheme != '' }}
run: brew install xcbeautify
- name: Archive for ${{ matrix.sdk }} SDK
run: |
xcodebuild archive \
-workspace ${{ inputs.workspaceFile }} \
-scheme ${{ inputs.scheme }} \
-configuration ${{ inputs.configuration }} \
-sdk ${{ matrix.sdk }} \
-archivePath './.build/${{ inputs.xcArchiveName }}-${{ matrix.sdk }}.xcarchive' \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
ONLY_ACTIVE_ARCH=NO \
CI=TRUE \
VERSION_NUMBER=${{ inputs.version }} \
SWIFT_OBJC_INTEROP_MODE=${{ (inputs.cxxInterop && 'objcxx') || 'objc' }} \
| xcbeautify
- name: Package the XCArchive # To preserve symlinks within the XCArchives that are not preserved by the GitHub Actions artifact upload
run: |
cd .build
tar -zcvf ${{ inputs.xcArchiveName }}-${{ matrix.sdk }}.xcarchive.tar.gz ${{ inputs.xcArchiveName }}-${{ matrix.sdk }}.xcarchive
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.xcArchiveName }}-${{ matrix.sdk }}.xcarchive.tar.gz
path: ./.build/${{ inputs.xcArchiveName }}-${{ matrix.sdk }}.xcarchive.tar.gz
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Check environment
run: |
xcodebuild -version
swift --version
echo Release version: ${{ inputs.version }}
echo SDK: ${{ matrix.sdk }}
- name: Install xcbeautify
if: ${{ !env.selfhosted && inputs.scheme != '' }}
run: brew install xcbeautify
- name: Archive for ${{ matrix.sdk }} SDK
run: |
xcodebuild archive \
-workspace ${{ inputs.workspaceFile }} \
-scheme ${{ inputs.scheme }} \
-configuration ${{ inputs.configuration }} \
-sdk ${{ matrix.sdk }} \
-archivePath './.build/${{ inputs.xcArchiveName }}-${{ matrix.sdk }}.xcarchive' \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
ONLY_ACTIVE_ARCH=NO \
CI=TRUE \
VERSION_NUMBER=${{ inputs.version }} \
SWIFT_OBJC_INTEROP_MODE=${{ (inputs.cxxInterop && 'objcxx') || 'objc' }} \
| xcbeautify
- name: Package the XCArchive # To preserve symlinks within the XCArchives that are not preserved by the GitHub Actions artifact upload
run: |
cd .build
tar -zcvf ${{ inputs.xcArchiveName }}-${{ matrix.sdk }}.xcarchive.tar.gz ${{ inputs.xcArchiveName }}-${{ matrix.sdk }}.xcarchive
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.xcArchiveName }}-${{ matrix.sdk }}.xcarchive.tar.gz
path: ./.build/${{ inputs.xcArchiveName }}-${{ matrix.sdk }}.xcarchive.tar.gz
Loading

0 comments on commit 46fd6e7

Please sign in to comment.