Skip to content

Commit a75d67e

Browse files
authored
Merge pull request #3823 from brandonpage/cleanup-github-actions
Fix Github Actions Chceckout
2 parents f74047f + 8e3a043 commit a75d67e

File tree

5 files changed

+37
-53
lines changed

5 files changed

+37
-53
lines changed

.github/DangerFiles/Gemfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
source("https://rubygems.org")
22

33
gem 'danger'
4-
gem 'plist'
5-
gem 'danger-xcode_summary'
4+
gem 'plist'

.github/DangerFiles/Gemfile.lock

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,57 +26,50 @@ GEM
2626
octokit (>= 4.0)
2727
pstore (~> 0.1)
2828
terminal-table (>= 1, < 4)
29-
danger-plugin-api (1.0.0)
30-
danger (> 2.0)
31-
danger-xcode_summary (1.3.1)
32-
danger-plugin-api (~> 1.0)
33-
xcresult (~> 0.2.2)
34-
faraday (2.12.0)
35-
faraday-net_http (>= 2.0, < 3.4)
29+
faraday (2.12.2)
30+
faraday-net_http (>= 2.0, < 3.5)
3631
json
3732
logger
3833
faraday-http-cache (2.5.1)
3934
faraday (>= 0.8)
40-
faraday-net_http (3.3.0)
41-
net-http
35+
faraday-net_http (3.4.0)
36+
net-http (>= 0.5.0)
4237
git (1.19.1)
4338
addressable (~> 2.8)
4439
rchardet (~> 1.8)
45-
json (2.7.5)
46-
kramdown (2.4.0)
47-
rexml
40+
json (2.9.1)
41+
kramdown (2.5.1)
42+
rexml (>= 3.3.9)
4843
kramdown-parser-gfm (1.1.0)
4944
kramdown (~> 2.0)
50-
logger (1.6.1)
45+
logger (1.6.5)
5146
nap (1.1.0)
52-
net-http (0.4.1)
47+
net-http (0.6.0)
5348
uri
5449
octokit (9.2.0)
5550
faraday (>= 1, < 3)
5651
sawyer (~> 0.9)
5752
open4 (1.3.4)
58-
plist (3.7.1)
59-
pstore (0.1.3)
53+
plist (3.7.2)
54+
pstore (0.1.4)
6055
public_suffix (6.0.1)
61-
rchardet (1.8.0)
62-
rexml (3.3.9)
56+
rchardet (1.9.0)
57+
rexml (3.4.0)
6358
sawyer (0.9.2)
6459
addressable (>= 2.3.5)
6560
faraday (>= 0.17.3, < 3)
6661
terminal-table (3.0.2)
6762
unicode-display_width (>= 1.1.1, < 3)
6863
unicode-display_width (2.6.0)
69-
uri (0.13.1)
70-
xcresult (0.2.2)
64+
uri (1.0.2)
7165

7266
PLATFORMS
7367
arm64-darwin-23
7468
ruby
7569

7670
DEPENDENCIES
7771
danger
78-
danger-xcode_summary
7972
plist
8073

8174
BUNDLED WITH
82-
2.5.22
75+
2.5.22

.github/DangerFiles/TestResults.rb

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/pr.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
# We need a sufficient depth or Danger will occasionally run into issues checking which files were modified.
3535
fetch-depth: 100
3636
# This is dangerous without the member check
37-
ref: ${{ github.head_ref }}
37+
ref: ${{ github.event.pull_request.head.sha }}
3838
- name: Install Dependencies
3939
run: |
4040
npm install shelljs@0.8.5
@@ -52,10 +52,12 @@ jobs:
5252
- name: Report Static Analysis
5353
env:
5454
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
run: bundle exec danger --dangerfile=StaticAnalysis.rb --danger_id=StaticAnalysis
55+
run: bundle exec danger --dangerfile=.github/DanagerFiles/StaticAnalysis.rb --danger_id=StaticAnalysis
5656

5757
test-orchestrator:
5858
runs-on: macos-15
59+
env:
60+
BUNDLE_GEMFILE: ${{ github.workspace }}/.github/DangerFiles/Gemfile
5961
outputs:
6062
libs: ${{ steps.test-orchestrator.outputs.libs }}
6163
steps:
@@ -84,14 +86,15 @@ jobs:
8486
fetch-depth: 100
8587
# This is dangerous without the member check
8688
ref: ${{ github.event.pull_request.head.sha }}
89+
- uses: ruby/setup-ruby@v1
90+
with:
91+
ruby-version: '3.3'
92+
bundler-cache: true
8793
- name: Determine Tests to Run
8894
id: test-orchestrator
8995
env:
9096
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91-
run: |
92-
cd .github/DangerFiles
93-
bundle update && bundle install
94-
bundle exec danger --dangerfile=TestOrchestrator.rb
97+
run: bundle exec danger --dangerfile=.github/DangerFiles/TestOrchestrator.rb --danger_id="TestOrchestrator"
9598

9699
ios-pr:
97100
needs: [test-orchestrator]
@@ -102,4 +105,5 @@ jobs:
102105
uses: ./.github/workflows/reusable-workflow.yaml
103106
with:
104107
lib: ${{ matrix.lib }}
108+
is_pr: true
105109
secrets: inherit

.github/workflows/reusable-workflow.yaml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@ on:
1616
default: macos-15
1717
required: false
1818
type: string
19+
is_pr:
20+
type: boolean
21+
default: false
1922

2023
jobs:
2124
test-ios:
2225
runs-on: ${{ inputs.macos }}
23-
env:
24-
BUNDLE_GEMFILE: ${{ github.workspace }}/.github/DangerFiles/Gemfile
2526
steps:
2627
- uses: actions/checkout@v4
27-
# We need a sufficient depth or Danger will occasionally run into issues
28-
# checking which files were modified.
28+
if: ${{ inputs.is_pr }}
29+
with:
30+
ref: ${{ github.event.pull_request.head.sha }}
31+
- uses: actions/checkout@v4
32+
if: ${{ ! inputs.is_pr }}
2933
with:
30-
fetch-depth: 100
3134
ref: ${{ github.head_ref }}
3235
- name: Install Dependencies
3336
env:
@@ -46,15 +49,10 @@ jobs:
4649
code-coverage: true
4750
upload-logs: always
4851
verbosity: xcbeautify
49-
- uses: ruby/setup-ruby@v1
52+
- uses: slidoapp/xcresulttool@v3.1.0
5053
with:
51-
ruby-version: '3.3'
52-
bundler-cache: true
53-
- name: Danger Test Results
54-
if: (github.event_name == 'pull_request') && failure()
55-
env:
56-
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57-
run: bundle exec danger --dangerfile=TestResults.rb --danger_id=${{ inputs.lib }}
54+
path: test.xcresult
55+
if: success() || failure()
5856
- uses: codecov/codecov-action@v4
5957
with:
6058
flags: ${{ inputs.lib }}

0 commit comments

Comments
 (0)