From d031c2a6c694d54b346d4f172bfb2a989883cb7a Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Thu, 24 Aug 2023 02:39:01 +0900 Subject: [PATCH 1/3] chore: Aggregate iOS setup actions --- .github/actions/setup-ios/action.yml | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/actions/setup-ios/action.yml diff --git a/.github/actions/setup-ios/action.yml b/.github/actions/setup-ios/action.yml new file mode 100644 index 000000000..f08eee155 --- /dev/null +++ b/.github/actions/setup-ios/action.yml @@ -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 \ No newline at end of file From 3e454ffcb95d338cf1709cc744d40d8226e533d5 Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Thu, 24 Aug 2023 02:39:49 +0900 Subject: [PATCH 2/3] chore: Configure run-name and erase undetermined remote scripts for each workflow --- .github/workflows/ActionLint.yml | 20 ++++++++++++++----- .github/workflows/Build.yml | 2 ++ .github/workflows/CompareScreenshot.yml | 2 ++ .../workflows/CompareScreenshotComment.yml | 2 ++ .github/workflows/DropStaging.yml | 2 ++ .github/workflows/Format.yml | 2 +- .github/workflows/StagePullRequest.yml | 2 ++ .github/workflows/StagePush.yml | 2 ++ .github/workflows/UnitTest.yml | 2 +- .github/workflows/iOSBuild.yml | 19 +++++------------- .github/workflows/iOSLint.yml | 5 ++++- 11 files changed, 38 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ActionLint.yml b/.github/workflows/ActionLint.yml index da16c25a8..4e0518c3e 100644 --- a/.github/workflows/ActionLint.yml +++ b/.github/workflows/ActionLint.yml @@ -2,8 +2,14 @@ on: push: paths: - '.github/workflows/**' + pull_request: + paths: + - '.github/workflows/**' + +name: "Actionlint" + +run-name: "Run ActionLint by ${{ github.actor }}" -name: "Trigger: Push action" permissions: {} jobs: @@ -12,8 +18,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 \ No newline at end of file + run: actionlint -color diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 03f0b2ea7..e5d6679bf 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -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: diff --git a/.github/workflows/CompareScreenshot.yml b/.github/workflows/CompareScreenshot.yml index 2dc4c856f..7498e042d 100644 --- a/.github/workflows/CompareScreenshot.yml +++ b/.github/workflows/CompareScreenshot.yml @@ -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: diff --git a/.github/workflows/CompareScreenshotComment.yml b/.github/workflows/CompareScreenshotComment.yml index 32b172610..725e8f6d0 100644 --- a/.github/workflows/CompareScreenshotComment.yml +++ b/.github/workflows/CompareScreenshotComment.yml @@ -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: diff --git a/.github/workflows/DropStaging.yml b/.github/workflows/DropStaging.yml index 583357f3f..d44f5909e 100644 --- a/.github/workflows/DropStaging.yml +++ b/.github/workflows/DropStaging.yml @@ -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" diff --git a/.github/workflows/Format.yml b/.github/workflows/Format.yml index 4bb0ca57c..d6a5e7b2c 100644 --- a/.github/workflows/Format.yml +++ b/.github/workflows/Format.yml @@ -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 }} diff --git a/.github/workflows/StagePullRequest.yml b/.github/workflows/StagePullRequest.yml index 78c72974b..2c76e94f1 100644 --- a/.github/workflows/StagePullRequest.yml +++ b/.github/workflows/StagePullRequest.yml @@ -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: > diff --git a/.github/workflows/StagePush.yml b/.github/workflows/StagePush.yml index 982af9d41..f14a905e7 100644 --- a/.github/workflows/StagePush.yml +++ b/.github/workflows/StagePush.yml @@ -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: > diff --git a/.github/workflows/UnitTest.yml b/.github/workflows/UnitTest.yml index efe0f18a8..393d7c395 100644 --- a/.github/workflows/UnitTest.yml +++ b/.github/workflows/UnitTest.yml @@ -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: { } diff --git a/.github/workflows/iOSBuild.yml b/.github/workflows/iOSBuild.yml index 6c5ad1537..1b7556bc6 100644 --- a/.github/workflows/iOSBuild.yml +++ b/.github/workflows/iOSBuild.yml @@ -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 @@ -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 }} diff --git a/.github/workflows/iOSLint.yml b/.github/workflows/iOSLint.yml index 019b9b85c..53c65838a 100644 --- a/.github/workflows/iOSLint.yml +++ b/.github/workflows/iOSLint.yml @@ -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 @@ -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 From 592660fe5c44ed415f960f5c65f40dcfec7dd975 Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Thu, 24 Aug 2023 02:42:43 +0900 Subject: [PATCH 3/3] chore: Fix a trigger of ActionLint for push --- .github/workflows/ActionLint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ActionLint.yml b/.github/workflows/ActionLint.yml index 4e0518c3e..a5e28e705 100644 --- a/.github/workflows/ActionLint.yml +++ b/.github/workflows/ActionLint.yml @@ -2,6 +2,8 @@ on: push: paths: - '.github/workflows/**' + branches: + - main pull_request: paths: - '.github/workflows/**'