From ca35adc6ca8811917e3d0af0a9be03aa6b746088 Mon Sep 17 00:00:00 2001 From: Mobile AppleDev Date: Mon, 13 May 2024 18:26:16 +0200 Subject: [PATCH] ci: move caching before npm install, bump action versions --- .github/workflows/build.yaml | 21 +++++++++++---------- package.json | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c8218183..a3302c92 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -119,6 +119,10 @@ jobs: echo "CONFIGURED:" cat $GITHUB_OUTPUT + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc - name: Cache node modules uses: actions/cache@v4 with: @@ -152,15 +156,15 @@ jobs: run: echo "MAPBOX_DOWNLOADS_TOKEN=${{ secrets.MAPBOX_TOKEN }}" >> android/local.properties - name: Gradle Wrapper Validation - uses: gradle/wrapper-validation-action@v1 + uses: gradle/actions/wrapper-validation@v3 - name: Setup Ruby uses: ruby/setup-ruby@v1 with: bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: .nvmrc - name: Cache node modules uses: actions/cache@v4 with: @@ -249,9 +253,9 @@ jobs: with: bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: .nvmrc - name: Cache node modules uses: actions/cache@v4 with: @@ -259,16 +263,13 @@ jobs: key: ${{ runner.os }}-npm-${{ hashFiles('./package-lock.json') }} - name: Setup .npmrc run: printf '@polito:registry=https://npm.pkg.github.com\n//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}\n' > .npmrc - - name: Install npm dependencies - run: npm install - name: Cache pods uses: actions/cache@v4 with: path: ./ios/Pods key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} - - name: Install pod dependencies - working-directory: ./ios - run: bundle exec pod install --repo-update + - name: Install npm dependencies + run: npm install - name: Prepare fastlane working-directory: ./ios run: | diff --git a/package.json b/package.json index cd617ae4..6dd156cb 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "format": "prettier --write '**/*.{ts,tsx,md}'", "types:check": "tsc --noEmit", "check": "npm run lint:check && npm run format:check && npm run types:check", - "postinstall": "react-native setup-ios-permissions" + "postinstall": "react-native setup-ios-permissions && pod-install" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.2.1",