Skip to content

Commit f889a83

Browse files
authored
Add readme for podspec presubmit tests (#7968)
* Add readme for podspec presubmit tests
1 parent 46e3293 commit f889a83

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

scripts/create_spec_repo/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Podspec presubmit test setup
2+
3+
Podspec presubmit test is to help ensure podspec is releasable. 'pod spec lint' will run for SDKs
4+
with sources of
5+
6+
- https://github.com/firebase/SpecsTesting
7+
- https://github.com/firebase/SpecsDev.git
8+
- https://github.com/firebase/SpecsStaging.git
9+
- https://cdn.cocoapods.org/
10+
11+
where [SpecsTesting](https://github.com/firebase/SpecsTesting) is generated from the head of the
12+
master branch of [firebase-ios-sdk repo](https://github.com/firebase/firebase-ios-sdk).
13+
14+
The [prerelease workflow](https://github.com/firebase/firebase-ios-sdk/blob/master/.github/workflows/prerelease.yml#L11-L46)
15+
will update the [SpecsTesting repo](https://github.com/firebase/SpecsTesting) nightly from the
16+
head of the master branch.
17+
In order to let presubmit tests run on the latest podspec repo, [SpecsTesting repo](https://github.com/firebase/SpecsTesting)
18+
will be updated when a PR with changed podspecs is merged.
19+
When this PR is merged, changed podspecs will be `pod repo push`ed to the podspec repo in
20+
[postsubmit tests](https://github.com/firebase/firebase-ios-sdk/blob/master/.github/workflows/prerelease.yml#L48-L94).
21+
22+
Since `pod spec lint` will test podspecs with remote sources. One PR with changes on multiple
23+
podspecs are not encouraged. Changes with multiple podspecs, including their dependencies, might
24+
fail presubmit tests.
25+
26+
## Set up presubmit tests
27+
28+
To set up presubmit tests, we can add a new job in SDK workflows. An example of `FirebaseDatabase`
29+
is shown below.
30+
`github.event.pull_request.merged != true && github.event.action != 'closed'` is to trigger this
31+
job in presubmit.
32+
```
33+
podspec-presubmit:
34+
# Don't run on private repo unless it is a PR.
35+
if: github.repository == 'Firebase/firebase-ios-sdk' && github.event.pull_request.merged != true && github.event.action != 'closed'
36+
runs-on: macOS-latest
37+
steps:
38+
- uses: actions/checkout@v2
39+
- name: Setup Bundler
40+
run: scripts/setup_bundler.sh
41+
- name: Build and test
42+
run: scripts/third_party/travis/retry.sh pod spec lint FirebaseDatabase.podspec --skip-tests --sources='https://github.com/firebase/SpecsTesting','https://github.com/firebase/SpecsDev.git','https://github.com/firebase/SpecsStaging.git','https://cdn.cocoapods.org/'
43+
44+
```
45+
46+
Once a PR is merged, [`update_SpecsTesting_repo` job](https://github.com/firebase/firebase-ios-sdk/blob/master/.github/workflows/prerelease.yml#L48)
47+
in the [prerelease workflow](https://github.com/firebase/firebase-ios-sdk/blob/master/.github/workflows/prerelease.yml)
48+
will automatically `pod repo push` changed podspecs in postsubmits,

0 commit comments

Comments
 (0)