Skip to content

Commit

Permalink
chore: add ci for swiftlint
Browse files Browse the repository at this point in the history
  • Loading branch information
matinzd committed Aug 14, 2023
1 parent 161327a commit 5aafaa4
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 6 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Setup & Lint Package

on:
pull_request:
branches:
- master

# Only run on the latest workflow run
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
setup-and-lint-package:
runs-on: macos-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Enable corepack
run: corepack enable

- name: Install CocoaPods
run: sudo gem install cocoapods

- name: Install Dependencies
run: yarn install --immutable

- name: Build project
run: yarn setup

- name: SwiftLint
run: yarn lint:swift
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Contributions are welcome and are greatly appreciated! Every little bit helps, and credit will
always be given.


## Setting up your environment

After forking to your own github org, do the following steps to get started:
Expand Down Expand Up @@ -65,7 +64,7 @@ brew install swiftlint
And then you can run it by calling it from JS using:

```bash
yarn lint:ios
yarn lint:swift
```

Or let it work on its own, as it is part of the build phases for the iOS project
Expand All @@ -82,7 +81,6 @@ After this, you can open up your browser to the specified port (usually http://l

The browser will automatically refresh when there are changes to any of the source files.


## Pull Request Guidelines

Before you submit a pull request from your forked repo, check that it meets these guidelines:
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"fabric:ios": "yarn workspace fabric-example ios",
"paper:android": "yarn workspace paper-example android",
"paper:ios": "yarn workspace paper-example ios",
"lint:ios": "swiftlint ./packages/core/ios",
"lint-fix:ios": "swiftlint --fix ./packages/core/ios",
"lint:swift": "yarn workspace lottie-react-native lint:swift",
"docs:clean": "rimraf _book",
"docs:prepare": "gitbook install",
"docs:build": "yarn docs:prepare && gitbook build",
Expand Down
4 changes: 3 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
},
"scripts": {
"build": "bob build",
"release": "release-it"
"release": "release-it",
"lint:swift": "swiftlint ios",
"lint-fix:swift": "swiftlint --fix ios"
},
"peerDependencies": {
"react": "*",
Expand Down

0 comments on commit 5aafaa4

Please sign in to comment.