diff --git a/.github/workflows/platform-validation-skip.yml b/.github/workflows/platform-validation-skip.yml deleted file mode 100644 index 828d1a105..000000000 --- a/.github/workflows/platform-validation-skip.yml +++ /dev/null @@ -1,32 +0,0 @@ -# this validation workflow bypasses the standard platform-validation.yml -# if only documentation has been modified. -name: platform-validation -on: - push: - branches: - - main - paths: - - 'docs/**' - pull_request: - branches: - - main - paths: - - 'docs/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build-android: - runs-on: ubuntu-latest - steps: - - run: 'echo "No build required"' - build-ios: - runs-on: ubuntu-latest - steps: - - run: 'echo "No build required"' - check-typescript: - runs-on: ubuntu-latest - steps: - - run: 'echo "No build required"' diff --git a/.github/workflows/platform-validation.yml b/.github/workflows/platform-validation.yml deleted file mode 100644 index 99adadfd1..000000000 --- a/.github/workflows/platform-validation.yml +++ /dev/null @@ -1,115 +0,0 @@ -name: platform-validation -on: - push: - branches: [main] - paths-ignore: ['docs/**'] - pull_request: - branches: [main, 'feature/**'] - paths-ignore: ['docs/**'] -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true -jobs: - build-android: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: 'yarn' - - name: Install Library Dependencies - run: yarn install --frozen-lockfile - - name: Build Library - run: yarn build - - name: Install Mobile Dependencies - run: |- - cd example - yarn install - - name: Cache Gradle Wrapper - uses: actions/cache@v2 - with: - path: ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }} - - name: Cache Gradle Dependencies - uses: actions/cache@v2 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-caches-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle-caches- - - name: Build App - run: |- - cd example/android - ./gradlew assembleDebug --no-daemon - build-ios: - runs-on: macos-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: 'yarn' - - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1.0' - bundler-cache: false - - name: Install Library Dependencies - run: yarn install --frozen-lockfile - - name: Build Library - run: yarn build - - name: Install Example Dependencies - run: |- - cd example - yarn install --frozen-lockfile - - name: Bundler - run: |- - cd example/ios - bundle install - - name: Cache Cocoapods Dependencies - uses: actions/cache@v2 - with: - path: example/ios/Pods - key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock') }} - restore-keys: | - ${{ runner.os }}-pods- - - name: Cococapods - run: |- - cd example/ios - bundle exec pod install - - name: Build App - run: |- - cd example/ios - xcodebuild build -workspace RNTPExample.xcworkspace -scheme RNTPExample -destination 'platform=iOS Simulator,name=iPhone 12 Pro' - check-typescript: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: 'yarn' - - name: Install Dependencies - run: |- - yarn install --frozen-lockfile - - name: Install Example Dependencies - run: |- - cd example - yarn install --frozen-lockfile - - name: Check Lint, Format & Types - run: | - yarn run ci:lint - yarn run ci:format - yarn run types - - name: Example - Check Lint, Format & Types - run: | - cd example - yarn run ci:lint - yarn run ci:format - yarn run types diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/publish-docs.yml similarity index 96% rename from .github/workflows/docs-deploy.yml rename to .github/workflows/publish-docs.yml index d9db3da4e..be4e2b7f9 100644 --- a/.github/workflows/docs-deploy.yml +++ b/.github/workflows/publish-docs.yml @@ -3,7 +3,7 @@ on: branches: - main paths: - - '.github/workflows/deploy.yml' + - '.github/workflows/publish-docs.yml' - 'docs/**' jobs: diff --git a/.github/workflows/test-docs-deploy.yml b/.github/workflows/test-docs-deploy.yml deleted file mode 100644 index 44e613861..000000000 --- a/.github/workflows/test-docs-deploy.yml +++ /dev/null @@ -1,29 +0,0 @@ -on: - pull_request: - branches: - - main - paths: - - '.github/workflows/deploy.yml' - - 'docs/**' - # Review gh actions docs if you want to further define triggers, paths, etc - # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on - -jobs: - test-deploy: - runs-on: ubuntu-latest - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - defaults: - run: - working-directory: docs - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v3 - with: - node-version: 16.x - cache: yarn - - - name: Install dependencies - run: yarn install --frozen-lockfile - - name: Test build website - run: yarn build diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 000000000..336477b25 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,186 @@ +name: validate +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + check-changes: + runs-on: ubuntu-latest + outputs: + should-build-docs: ${{ steps.filter.outputs.docs || steps.filter.outputs.workflow }} + should-build-ios: ${{ steps.filter.outputs.ios || steps.filter.outputs.workflow || steps.filter.outputs.js }} + should-build-android: ${{ steps.filter.outputs.android || steps.filter.outputs.workflow || steps.filter.outputs.js }} + should-check-types: ${{ steps.filter.outputs.js || steps.filter.outputs.workflow }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + workflow: + - '.github/workflows/validate.yml' + js: + - 'src/**' + - '**.json' + - '**.js' + - 'example/src/**' + - 'example/**.json' + - 'example/**.js' + ios: + - 'ios/**' + - 'example/ios/**' + android: + - 'android/**' + - 'example/android/**' + docs: + - 'docs/**' + check-typescript: + runs-on: ubuntu-latest + needs: check-changes + steps: + - name: Checkout Repo + if: ${{ needs.check-changes.outputs.should-check-types }} + uses: actions/checkout@v4 + - name: Setup Environment + uses: pkgxdev/setup@v2 + with: + +: classic.yarnpkg.com + - name: Install Dependencies + if: ${{ needs.check-changes.outputs.should-check-types }} + run: |- + yarn install --frozen-lockfile + - name: Install Example Dependencies + if: ${{ needs.check-changes.outputs.should-check-types }} + run: |- + cd example + yarn install --frozen-lockfile + - name: Check Lint, Format & Types + if: ${{ needs.check-changes.outputs.should-check-types }} + run: | + yarn run ci:lint + yarn run ci:format + yarn run types + - name: Example - Check Lint, Format & Types + if: ${{ needs.check-changes.outputs.should-check-types }} + run: | + cd example + yarn run ci:lint + yarn run ci:format + yarn run types + build-ios: + runs-on: blaze/macos-14 + needs: check-changes + steps: + - name: Checkout Repo + if: ${{ needs.check-changes.outputs.should-build-ios }} + uses: actions/checkout@v4 + - name: Setup Environment + uses: pkgxdev/setup@v2 + with: + +: ruby-lang.org@3.1.0 + classic.yarnpkg.com + tuist.io/xcbeautify + - name: Install Library Dependencies + if: ${{ needs.check-changes.outputs.should-build-ios }} + run: yarn install --frozen-lockfile + - name: Build Library + if: ${{ needs.check-changes.outputs.should-build-ios }} + run: yarn build + - name: Install Example Dependencies + if: ${{ needs.check-changes.outputs.should-build-ios }} + run: |- + cd example + yarn install --frozen-lockfile + - name: Bundle Install + if: ${{ needs.check-changes.outputs.should-build-ios }} + run: |- + cd example/ios + pkgx +ruby-lang.org@3.1.0 gem install bundler + pkgx +ruby-lang.org@3.1.0 bundle config set --local path 'vendor/bundle' + pkgx +ruby-lang.org@3.1.0 bundle install + - name: Cache Cocoapods Dependencies + if: ${{ needs.check-changes.outputs.should-build-ios }} + uses: buildjet/cache@v4 + with: + path: example/ios/Pods + key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock') }} + restore-keys: | + ${{ runner.os }}-pods- + - name: Install Cococapods + if: ${{ needs.check-changes.outputs.should-build-ios }} + run: |- + cd example/ios + pkgx +ruby-lang.org@3.1.0 bundle exec pod install + - name: Build App + if: ${{ needs.check-changes.outputs.should-build-ios }} + run: |- + cd example/ios + set -o pipefail && xcodebuild build -workspace RNTPExample.xcworkspace -scheme RNTPExample -destination 'platform=iOS Simulator,name=iPhone 15 Pro' | xcbeautify --renderer github-actions + build-android: + runs-on: ubuntu-latest + needs: check-changes + steps: + - name: Checkout Repo + if: ${{ needs.check-changes.outputs.should-build-android }} + uses: actions/checkout@v4 + - name: Setup Environment + uses: pkgxdev/setup@v2 + with: + +: classic.yarnpkg.com + - name: Install Library Dependencies + if: ${{ needs.check-changes.outputs.should-build-android }} + run: yarn install --frozen-lockfile + - name: Build Library + if: ${{ needs.check-changes.outputs.should-build-android }} + run: yarn build + - name: Install Mobile Dependencies + if: ${{ needs.check-changes.outputs.should-build-android }} + run: |- + cd example + yarn install + - name: Cache Gradle Wrapper + if: ${{ needs.check-changes.outputs.should-build-android }} + uses: actions/cache@v4 + with: + path: ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }} + - name: Cache Gradle Dependencies + if: ${{ needs.check-changes.outputs.should-build-android }} + uses: actions/cache@v4 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-caches-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle-caches- + - name: Build App + if: ${{ needs.check-changes.outputs.should-build-android }} + run: |- + cd example/android + ./gradlew assembleDebug --no-daemon + build-docs: + runs-on: ubuntu-latest + needs: check-changes + defaults: + run: + working-directory: docs + steps: + - name: Checkout Repo + if: ${{ needs.check-changes.outputs.should-build-docs }} + uses: actions/checkout@v4 + - name: Setup Environment + uses: pkgxdev/setup@v2 + with: + +: classic.yarnpkg.com + - name: Install Dependencies + if: ${{ needs.check-changes.outputs.should-build-docs }} + run: |- + yarn install --frozen-lockfile + - name: Build Docs + if: ${{ needs.check-changes.outputs.should-build-docs }} + run: |- + yarn build diff --git a/README.md b/README.md index c54f574ed..e101d2efd 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,22 @@ A fully-fledged audio module created for music apps. Provides audio playback, external media controls, background mode and more! +