ci: skip builds checks for docs #29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - 'docs/**' | |
| - '*.md' | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - 'docs/**' | |
| - '*.md' | |
| jobs: | |
| lint-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Lint | |
| run: yarn workspace @bernagl/react-native-date lint | |
| - name: Type check | |
| run: yarn workspace @bernagl/react-native-date typecheck | |
| - name: Run tests | |
| run: yarn workspace @bernagl/react-native-date test | |
| - name: Build | |
| run: yarn workspace @bernagl/react-native-date prepare | |
| build-android: | |
| runs-on: ubuntu-latest | |
| needs: lint-and-test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Build library | |
| run: yarn workspace @bernagl/react-native-date prepare | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Build Android example | |
| working-directory: packages/example/android | |
| run: ./gradlew assembleDebug --no-daemon | |
| build-ios: | |
| runs-on: macos-latest | |
| needs: lint-and-test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Build library | |
| run: yarn workspace @bernagl/react-native-date prepare | |
| - name: Cache CocoaPods | |
| uses: actions/cache@v4 | |
| with: | |
| path: packages/example/ios/Pods | |
| key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pods- | |
| - name: Install CocoaPods | |
| working-directory: packages/example/ios | |
| run: pod install | |
| - name: Build iOS example | |
| working-directory: packages/example/ios | |
| run: | | |
| xcodebuild \ | |
| -workspace NativeDateExample.xcworkspace \ | |
| -scheme NativeDateExample \ | |
| -sdk iphonesimulator \ | |
| -configuration Debug \ | |
| -destination 'generic/platform=iOS Simulator' \ | |
| build \ | |
| CODE_SIGNING_ALLOWED=NO |