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

Lint podspec on all pull requests #1758

Merged
merged 1 commit into from
Jan 3, 2020
Merged
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
26 changes: 26 additions & 0 deletions .github/workflows/ci-pull-requests-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI (pull-requests-only jobs)

on:
pull_request:
branches:
- master

jobs:
buildsh:
env:
DEVELOPER_DIR: /Applications/Xcode_11.app/Contents/Developer
strategy:
matrix:
mode: [cocoapods-lint-default-subspecs, cocoapods-lint-other-subspecs]
include:
- mode: cocoapods-lint-default-subspecs
name: Verify that default subspecs lint
- mode: cocoapods-lint-other-subspecs
name: Verify that other subspecs lint
name: ${{ matrix.name }}
runs-on: macOS-latest
steps:
- name: Checkout the Git repository
uses: actions/checkout@v1
- name: Run build script
run: ./build.sh ${{ matrix.mode }}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
- name: Checkout the Git repository
uses: actions/checkout@v1
- name: Run build script
run: ./build.sh ${{ matrix.mode }}
run: ./build.sh ${{ matrix.mode }}
27 changes: 27 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ function build_example {
fi
}

# Lint subspec
function lint_subspec {
set -o pipefail && pod env && pod lib lint --allow-warnings --subspec="$1"
}

function cleanup {
# remove all Pods directories
find . -name Pods -type d -exec rm -rf {} +
Expand Down Expand Up @@ -216,6 +221,28 @@ cocoapods-lint|all)
success="1"
;;

cocoapods-lint-default-subspecs)
echo "Verifying that default subspecs lint."

for subspec in 'Core' 'PINRemoteImage' 'Video' 'MapKit' 'AssetsLibrary' 'Photos'; do
echo "Verifying that $subspec subspec lints."

lint_subspec $subspec
done
success="1"
;;

cocoapods-lint-other-subspecs)
echo "Verifying that other subspecs lint."

for subspec in 'IGListKit' 'Yoga' 'TextNode2'; do
echo "Verifying that $subspec subspec lints."

lint_subspec $subspec
done
success="1"
;;

carthage|all)
echo "Verifying carthage works."

Expand Down