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

Configure workflows to use proper run-names and for DRY #923

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 29 additions & 0 deletions .github/actions/setup-ios/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Setup the build environment for iOS builds"
description: "setup Xcode, Swift package manager, fastlane and gradle"

inputs:
arch:
description: "The architecture to build for iOS framework." # behaves as a named variable
default: "x86_64"
outputs:
working-directory:
description: "The working directory to build the iOS project." # behaves as a named variable
value: "app-ios"

runs:
using: "composite"
steps:
- name: Set up Ruby
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
with:
bundler-cache: true

- uses: ./.github/actions/xcode-select

- uses: ./.github/actions/setup-java

- shell: bash
name: Set up XCFramework arch filter
run: echo "arch=${{ inputs.arch }}" >> local.properties

- uses: ./.github/actions/spm
22 changes: 17 additions & 5 deletions .github/workflows/ActionLint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@ on:
push:
paths:
- '.github/workflows/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/**'

name: "Actionlint"

run-name: "Run ActionLint by ${{ github.actor }}"

name: "Trigger: Push action"
permissions: {}

jobs:
Expand All @@ -12,8 +20,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- uses: jaxxstorm/action-install-gh-release@c5ead9a448b4660cf1e7866ee22e4dc56538031a #v1.10.0
with:
repo: rhysd/actionlint
tag: "v1.6.25"
cache: enable

- name: Run actionlint
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.6.25
./actionlint -color
shell: bash
run: actionlint -color
2 changes: 2 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

run-name: "Build Android project on ${{ github.event_name}}${{ github.event.pull_request.number && format('#{0}', github.event.pull_request.number) || '' }} by ${{ github.actor }}"

permissions: {}

jobs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/CompareScreenshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

run-name: "Compare screenshots on ${{ github.event_name}}#${{ github.event.pull_request.number }} by ${{ github.actor }}"

permissions: { }

jobs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/CompareScreenshotComment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}-${{ github.event.workflow_run.id }}
cancel-in-progress: true

run-name: "Comment screenshot diffs; ${{ github.event.workflow_run.name }} - ${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }}"

permissions: { }

jobs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/DropStaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
# Disable all permissions. We have to enable required permissions at job-level.
permissions: {}

run-name: "Drop a staging artifact for ${{ github.event_name}}#${{ github.event.pull_request.number }} by ${{ github.actor }}"

jobs:
drop-stage:
name: "Drop from staging"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths-ignore:
- 'app-ios/**'

run-name: "Format by ${{ github.actor }}"
run-name: "Format a project on ${{ github.event_name}}#${{ github.event.pull_request.number }} by ${{ github.actor }}"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/StagePullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
# Disable all permissions. We have to enable required permissions at job-level.
permissions: {}

run-name: "Promote a pr artifact to staging; ${{ github.event.workflow_run.name }} - ${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }}"

jobs:
stage-epic:
if: >
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/StagePush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
# Disable all permissions. We have to enable required permissions at job-level.
permissions: {}

run-name: "Promote a branch artifact to staging; ${{ github.event.workflow_run.name }} - ${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }}"

jobs:
stage-default:
if: >
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/UnitTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
paths-ignore:
- 'app-ios/**'

run-name: "UnitTest by ${{ github.actor }}"
run-name: "Run UnitTest on ${{ github.event_name}}${{ github.event.pull_request.number && format('#{0}', github.event.pull_request.number) || '' }} by ${{ github.actor }}"

permissions: { }

Expand Down
19 changes: 5 additions & 14 deletions .github/workflows/iOSBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ concurrency:
group: ios-build-${{ github.ref }}
cancel-in-progress: true

run-name: "Build iOS project on ${{ github.event_name}}${{ github.event.pull_request.number && format('#{0}', github.event.pull_request.number) || '' }} by ${{ github.actor }}"

jobs:
build-ios:
runs-on: macos-13
Expand All @@ -17,19 +19,8 @@ jobs:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Set up Ruby
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
with:
bundler-cache: true

- uses: ./.github/actions/xcode-select

- uses: ./.github/actions/setup-java

- name: Set up XCFramework arch filter
run: echo "arch=x86_64" >> local.properties

- uses: ./.github/actions/spm
- id: ios
uses: ./.github/actions/setup-ios

- run: bundle exec fastlane build
working-directory: app-ios
working-directory: ${{ steps.ios.outputs.working-directory }}
5 changes: 4 additions & 1 deletion .github/workflows/iOSLint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
paths:
- 'app-ios/**'

run-name: "Run lint for iOS on ${{ github.event_name}}#${{ github.event.pull_request.number }} by ${{ github.actor }}"

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -18,4 +20,5 @@ jobs:
fetch-depth: 1

- name: SwiftLint
run: cd app-ios && swiftlint lint --reporter github-actions-logging
run: swiftlint lint --reporter github-actions-logging
working-directory: app-ios