Update tanstack-query monorepo to v5 (major) #4410
This file contains 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: Check | |
on: | |
push: {branches: [master]} | |
pull_request: | |
merge_group: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
ruby-version: '3.1' | |
xcode_version: 'Xcode_15.2' | |
java_version: '11' | |
java_distribution: temurin | |
jobs: | |
cache-npm-linux: | |
name: Cache npm for Linux | |
runs-on: ubuntu-22.04 | |
outputs: | |
cache-key: ${{ steps.node-cache.outputs.cache-primary-key }} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Extract job definition | |
run: yq '.jobs.${{ github.job }}' .github/workflows/check.yml > .github/job.yml | |
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: node-cache | |
with: | |
path: node_modules/ | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('.node-version', 'package-lock.json', '.github/job.yml') }} | |
- if: steps.node-cache.outputs.cache-hit != 'true' | |
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | |
with: | |
node-version-file: '.node-version' | |
cache: npm | |
- if: steps.node-cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
if: steps.node-cache.outputs.cache-hit != 'true' | |
with: | |
path: node_modules/ | |
key: ${{ steps.node-cache.outputs.cache-primary-key }} | |
cache-npm-macos: | |
name: Cache npm for macOS | |
runs-on: macos-14 | |
outputs: | |
cache-key: ${{ steps.node-cache.outputs.cache-primary-key }} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Extract job definition | |
run: yq '.jobs.${{ github.job }}' .github/workflows/check.yml > .github/job.yml | |
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: node-cache | |
with: | |
path: node_modules/ | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('.node-version', 'package-lock.json', '.github/job.yml') }} | |
- if: steps.node-cache.outputs.cache-hit != 'true' | |
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | |
with: | |
node-version-file: '.node-version' | |
cache: npm | |
- if: steps.node-cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
if: steps.node-cache.outputs.cache-hit != 'true' | |
with: | |
path: node_modules/ | |
key: ${{ steps.node-cache.outputs.cache-primary-key }} | |
cache-bundler-macos: | |
name: Cache bundler for macOS | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ env.ruby-version }} | |
bundler-cache: true | |
cache-cocoapods: | |
name: iOS Cocoapods | |
needs: [cache-npm-macos, cache-bundler-macos] | |
runs-on: macos-14 | |
outputs: | |
cache-key: ${{ steps.cocoapods-cache.outputs.cache-primary-key }} | |
steps: | |
- run: sudo xcode-select -s /Applications/${{ env.xcode_version }}.app | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Extract job definition | |
run: yq '.jobs.${{ github.job }}' .github/workflows/check.yml > .github/job.yml | |
- name: Restore Cocoapods cache | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: cocoapods-cache | |
with: | |
path: ios/Pods | |
key: ${{ runner.os }}-cocoapods-ruby@${{ env.ruby-version }}-xcode@${{ env.xcode_version }}-${{ hashFiles('**/Podfile', '**/Podfile.lock', 'package-lock.json', '.github/job.yml') }} | |
- if: steps.cocoapods-cache.outputs.cache-hit != 'true' | |
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | |
with: | |
node-version-file: '.node-version' | |
- if: steps.cocoapods-cache.outputs.cache-hit != 'true' | |
uses: ruby/setup-ruby@v1 | |
env: | |
BUNDLE_FROZEN: "true" | |
with: | |
ruby-version: ${{ env.ruby-version }} | |
bundler-cache: true | |
- name: Restore node_modules cache | |
if: steps.cocoapods-cache.outputs.cache-hit != 'true' | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: node-cache | |
with: | |
path: node_modules/ | |
key: ${{ needs.cache-npm-macos.outputs.cache-key }} | |
- if: steps.cocoapods-cache.outputs.cache-hit != 'true' && steps.node-cache.outputs.cache-hit != 'true' | |
run: exit 1 | |
- if: steps.cocoapods-cache.outputs.cache-hit != 'true' | |
run: bundle exec pod install --deployment | |
working-directory: ./ios | |
- name: Save Cocoapods cache | |
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
if: steps.cocoapods-cache.outputs.cache-hit != 'true' | |
with: | |
path: ios/Pods | |
key: ${{ steps.cocoapods-cache.outputs.cache-primary-key }} | |
prettier: | |
name: Prettier | |
needs: [cache-npm-linux] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Restore node_modules cache | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: node-cache | |
with: | |
path: node_modules/ | |
key: ${{ needs.cache-npm-linux.outputs.cache-key }} | |
- if: steps.node-cache.outputs.cache-hit != 'true' | |
run: exit 1 | |
- run: npm run pretty -- --no-write --check | |
eslint: | |
name: ESLint | |
needs: [cache-npm-linux] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Restore node_modules cache | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: node-cache | |
with: | |
path: node_modules/ | |
key: ${{ needs.cache-npm-linux.outputs.cache-key }} | |
- if: steps.node-cache.outputs.cache-hit != 'true' | |
run: exit 1 | |
- run: npm run lint | |
jest: | |
name: Jest | |
needs: [cache-npm-linux] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Restore node_modules cache | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: node-cache | |
with: | |
path: node_modules/ | |
key: ${{ needs.cache-npm-linux.outputs.cache-key }} | |
- if: steps.node-cache.outputs.cache-hit != 'true' | |
run: exit 1 | |
- name: Run tests | |
run: npm run test -- --coverage | |
- name: Upload coverage | |
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4 | |
tsc: | |
name: TypeScript | |
needs: [cache-npm-linux] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Restore node_modules cache | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: node-cache | |
with: | |
path: node_modules/ | |
key: ${{ needs.cache-npm-linux.outputs.cache-key }} | |
- if: steps.node-cache.outputs.cache-hit != 'true' | |
run: exit 1 | |
- run: npx tsc | |
data: | |
name: Data | |
needs: [cache-npm-linux] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Restore node_modules cache | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: node-cache | |
with: | |
path: node_modules/ | |
key: ${{ needs.cache-npm-linux.outputs.cache-key }} | |
- if: steps.node-cache.outputs.cache-hit != 'true' | |
run: exit 1 | |
- run: npm run validate-data | |
- run: npm run bundle-data | |
ios-bundle: | |
name: iOS Bundle | |
needs: [cache-npm-macos] | |
runs-on: macos-14 | |
outputs: | |
cache-key: ${{ steps.jsbundle-cache.outputs.cache-primary-key }} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Extract job definition | |
run: yq '.jobs.${{ github.job }}' .github/workflows/check.yml > .github/job.yml | |
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Restore node_modules cache | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: node-cache | |
with: | |
path: node_modules/ | |
key: ${{ needs.cache-npm-macos.outputs.cache-key }} | |
- if: steps.node-cache.outputs.cache-hit != 'true' | |
run: exit 1 | |
- name: Load the cached jsbundle | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: jsbundle-cache | |
with: | |
path: | | |
ios/AllAboutOlaf/main.jsbundle | |
ios/AllAboutOlaf/main.jsbundle.map | |
ios/assets/ | |
key: ${{ runner.os }}-jsbundle-${{ hashFiles('.node-version', 'package.json', 'package-lock.json', '.github/job.yml', 'tsconfig.json', 'babel.config.js', 'index.js', 'data/**', 'images/**', 'modules/**.ts', 'modules/**.tsx', 'source/**.ts', 'source/**.tsx') }} | |
- name: Generate jsbundle | |
if: steps.jsbundle-cache.outputs.cache-hit != 'true' | |
run: npm run bundle:ios | |
env: | |
APP_MODE: mocked | |
- name: Cache the jsbundle | |
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
if: steps.jsbundle-cache.outputs.cache-hit != 'true' | |
with: | |
path: | | |
ios/AllAboutOlaf/main.jsbundle | |
ios/AllAboutOlaf/main.jsbundle.map | |
ios/assets/ | |
key: ${{ steps.jsbundle-cache.outputs.cache-primary-key }} | |
android-bundle: | |
name: Android Bundle | |
needs: [cache-npm-linux] | |
runs-on: ubuntu-22.04 | |
outputs: | |
cache-key: ${{ steps.jsbundle-cache.outputs.cache-primary-key }} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Extract job definition | |
run: yq '.jobs.${{ github.job }}' .github/workflows/check.yml > .github/job.yml | |
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Restore node_modules cache | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: node-cache | |
with: | |
path: node_modules/ | |
key: ${{ needs.cache-npm-linux.outputs.cache-key }} | |
- if: steps.node-cache.outputs.cache-hit != 'true' | |
run: exit 1 | |
- name: Load the cached jsbundle | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: jsbundle-cache | |
with: | |
path: ./android/generated/ | |
key: ${{ runner.os }}-jsbundle-${{ hashFiles('.node-version', 'package.json', 'package-lock.json', '.github/job.yml', 'tsconfig.json', 'babel.config.js', 'index.js', 'data/**', 'images/**', 'modules/**.ts', 'modules/**.tsx', 'source/**.ts', 'source/**.tsx') }} | |
- name: Generate jsbundle | |
if: steps.jsbundle-cache.outputs.cache-hit != 'true' | |
run: npm run bundle:android | |
env: | |
APP_MODE: mocked | |
- name: Cache the jsbundle | |
if: steps.jsbundle-cache.outputs.cache-hit != 'true' | |
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
with: | |
path: ./android/generated/ | |
key: ${{ steps.jsbundle-cache.outputs.cache-primary-key }} | |
android: | |
name: Build for Android | |
needs: [jest, eslint, android-bundle, cache-npm-linux] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Restore node_modules cache | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: node-cache | |
with: | |
path: node_modules/ | |
key: ${{ needs.cache-npm-linux.outputs.cache-key }} | |
- if: steps.node-cache.outputs.cache-hit != 'true' | |
run: exit 1 | |
- uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4 | |
with: | |
distribution: ${{ env.java_distribution }} | |
java-version: ${{ env.java_version }} | |
- name: Raise the fs.inotify ulimits to 524288 watches/queued events/user instances | |
run: | | |
echo 524288 | sudo tee -a /proc/sys/fs/inotify/max_user_watches | |
echo 524288 | sudo tee -a /proc/sys/fs/inotify/max_queued_events | |
echo 524288 | sudo tee -a /proc/sys/fs/inotify/max_user_instances | |
sudo sysctl -p | |
- name: Gradle | |
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3 | |
with: | |
arguments: bundleRelease --scan | |
build-root-directory: android | |
gradle-home-cache-cleanup: true | |
env: | |
SENTRY_ORG: frog-pond-labs | |
SENTRY_PROJECT: all-about-olaf | |
SKIP_BUNDLING: 'true' | |
- name: Upload build reports | |
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4 | |
with: | |
name: build-reports | |
path: build/reports/ | |
- name: Cache the Android app | |
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
with: | |
path: android/app/build/outputs/apk/ | |
key: ${{ steps.app-cache.outputs.cache-primary-key }} | |
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4 | |
with: | |
name: android-app | |
path: android/app/build/outputs/apk/ | |
ios-build: | |
name: Build for iOS | |
needs: [jest, eslint, cache-cocoapods, cache-npm-macos, cache-bundler-macos] | |
runs-on: macos-14 | |
outputs: | |
cache-key: ${{ steps.app-cache.outputs.cache-primary-key }} | |
steps: | |
- run: sudo xcode-select -s /Applications/${{ env.xcode_version }}.app | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Extract job definition | |
run: yq '.jobs.${{ github.job }}' .github/workflows/check.yml > .github/job.yml | |
- name: Check for cached iOS app | |
id: app-cache | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
with: | |
path: ios/build/Build/Products/ | |
key: ${{ runner.os }}-ios-xcode@${{ env.xcode_version }}-${{ hashFiles('**/project.pbxproj', '**/Podfile', '**/Podfile.lock', 'package-lock.json', '.github/job.yml') }} | |
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | |
if: steps.app-cache.outputs.cache-hit != 'true' | |
with: | |
node-version-file: '.node-version' | |
- name: Restore node_modules cache | |
if: steps.app-cache.outputs.cache-hit != 'true' | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: node-cache | |
with: | |
path: node_modules/ | |
key: ${{ needs.cache-npm-macos.outputs.cache-key }} | |
- name: exit if the node_modules cache did not load | |
if: steps.app-cache.outputs.cache-hit != 'true' && steps.node-cache.outputs.cache-hit != 'true' | |
run: exit 1 | |
- uses: ruby/setup-ruby@v1 | |
if: steps.app-cache.outputs.cache-hit != 'true' | |
env: | |
BUNDLE_FROZEN: "true" | |
with: | |
ruby-version: ${{ env.ruby-version }} | |
bundler-cache: true | |
- name: Restore Cocoapods cache | |
if: steps.app-cache.outputs.cache-hit != 'true' | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: pods-cache | |
with: | |
path: ios/Pods | |
key: ${{ needs.cache-cocoapods.outputs.cache-key }} | |
- name: exit if the Cocoapods cache did not load | |
if: steps.app-cache.outputs.cache-hit != 'true' && steps.pods-cache.outputs.cache-hit != 'true' | |
run: exit 1 | |
- uses: mikehardy/buildcache-action@1db83fb06b0da378aa7db7a1110923b904417cbc # v2 | |
if: steps.app-cache.outputs.cache-hit != 'true' | |
continue-on-error: true | |
with: | |
cache_key: ${{ matrix.os }} | |
upload_buildcache_log: 'true' | |
- name: Build the iOS app | |
if: ${{ steps.app-cache.outputs.cache-hit != 'true' && !contains(github.event.pull_request.labels.*.name, 'ci/skip-detox') }} | |
env: | |
SKIP_BUNDLING: 'true' | |
CODE_SIGNING_DISABLED: true | |
run: npx detox build e2e --configuration ios.sim.release | |
- name: Cache the iOS app | |
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
with: | |
path: ios/build/Build/Products/ | |
key: ${{ steps.app-cache.outputs.cache-primary-key }} | |
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4 | |
with: | |
name: ios-app | |
path: ios/build/Build/Products/ | |
ios-detox: | |
name: Detox E2E for iOS | |
needs: [cache-npm-macos, ios-build, ios-bundle] | |
runs-on: macos-14 | |
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci/skip-detox') }} | |
steps: | |
- run: sudo xcode-select -s /Applications/${{ env.xcode_version }}.app | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- # load the app before reinstalling detox, so that the package-lock cannot change | |
name: Load the cached iOS app | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: app-cache | |
with: | |
path: ios/build/Build/Products/ | |
key: ${{ needs.ios-build.outputs.cache-key }} | |
- if: steps.app-cache.outputs.cache-hit != 'true' | |
run: exit 1 | |
- # load the jsbundle before reinstalling detox, so that the package-lock cannot change | |
name: Load the cached iOS jsbundle | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: jsbundle-cache | |
with: | |
path: | | |
ios/AllAboutOlaf/main.jsbundle | |
ios/AllAboutOlaf/main.jsbundle.map | |
ios/assets/ | |
key: ${{ needs.ios-bundle.outputs.cache-key }} | |
- if: steps.jsbundle-cache.outputs.cache-hit != 'true' | |
run: exit 1 | |
- name: Move cached jsbundle into place | |
run: | | |
mv ios/AllAboutOlaf/main.jsbundle ios/build/Build/Products/Release-iphonesimulator/AllAboutOlaf.app/ | |
mv ios/AllAboutOlaf/main.jsbundle.map ios/build/Build/Products/Release-iphonesimulator/AllAboutOlaf.app/ | |
rm -rf ios/build/Build/Products/Release-iphonesimulator/AllAboutOlaf.app/assets | |
mv ios/assets ios/build/Build/Products/Release-iphonesimulator/AllAboutOlaf.app/ | |
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Restore node_modules cache | |
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: node-cache | |
with: | |
path: node_modules/ | |
key: ${{ needs.cache-npm-macos.outputs.cache-key }} | |
- # We have to poke Detox because it installs things outside of node_modules/detox/… | |
name: Re-install Detox | |
run: npx detox clean-framework-cache && npx detox build-framework-cache | |
- run: brew tap wix/brew | |
- run: brew install applesimutils | |
- name: Run the Detox tests | |
run: npx detox test e2e --configuration ios.sim.release --cleanup --record-logs failing --record-videos failing --record-performance all --capture-view-hierarchy enabled --take-screenshots failing | |
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4 | |
if: always() | |
with: | |
name: detox-ios | |
path: artifacts/ |