Skip to content

Commit

Permalink
test(ci): increase allowed yarn time / only cache on main
Browse files Browse the repository at this point in the history
yarn install is taking a much longer time now, unknown reasons
additionally this cache is large now so we'll only cache on main to
make sure we don't blow out main caches with multiple PRs in flight
  • Loading branch information
mikehardy committed Sep 1, 2023
1 parent e267860 commit 2847d33
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 26 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/create_test_patches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
name: Yarn Cache
- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -53,7 +53,7 @@ jobs:
- name: Yarn Install
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
timeout_minutes: 15
retry_wait_seconds: 60
max_attempts: 3
command: DETOX_DISABLE_POSTINSTALL=1 yarn --no-audit --prefer-offline
Expand Down Expand Up @@ -98,6 +98,13 @@ jobs:
name: patches
path: ~/template/patches/

- uses: actions/cache/save@v3
name: Yarn Cache Save
if: "${{ github.ref == 'refs/heads/main' }}"
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}

# create a comment on the PR and any related issues with a direct link to the archive,
# a call for testers, and perhaps a paste-able set of commands to install them
# (mkdir patches, curl -o etc, npx patch-package)
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Yarn Cache
- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Yarn Install
uses: nick-fields/retry@v2
with:
timeout_minutes: 3
timeout_minutes: 15
retry_wait_seconds: 30
max_attempts: 3
command: yarn --no-audit --prefer-offline
Expand All @@ -53,3 +53,9 @@ jobs:
- name: Spell check
run: |
yarn lint:spellcheck
- uses: actions/cache/save@v3
name: Yarn Cache Save
if: "${{ github.ref == 'refs/heads/main' }}"
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
38 changes: 29 additions & 9 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Yarn Cache
- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -43,7 +43,7 @@ jobs:
- name: Yarn Install
uses: nick-fields/retry@v2
with:
timeout_minutes: 3
timeout_minutes: 15
retry_wait_seconds: 30
max_attempts: 3
command: yarn --no-audit --prefer-offline
Expand All @@ -54,6 +54,13 @@ jobs:
retry_wait_seconds: 10
max_attempts: 3
command: yarn lint
- uses: actions/cache/save@v3
name: Yarn Cache Save
if: "${{ github.ref == 'refs/heads/main' }}"
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}


typescript:
name: TypeScript Build Validation
Expand All @@ -69,8 +76,8 @@ jobs:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Yarn Cache
- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -79,12 +86,19 @@ jobs:
- name: Yarn Install
uses: nick-fields/retry@v2
with:
timeout_minutes: 3
timeout_minutes: 15
retry_wait_seconds: 30
max_attempts: 3
command: yarn --no-audit --prefer-offline
- name: Lint
run: yarn tsc:compile
- uses: actions/cache/save@v3
name: Yarn Cache Save
if: "${{ github.ref == 'refs/heads/main' }}"
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}


typedoc:
name: TypeDoc Generation
Expand All @@ -100,8 +114,8 @@ jobs:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Yarn Cache
- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -110,7 +124,7 @@ jobs:
- name: Yarn Install
uses: nick-fields/retry@v2
with:
timeout_minutes: 3
timeout_minutes: 15
retry_wait_seconds: 30
max_attempts: 3
command: yarn --no-audit --prefer-offline
Expand All @@ -123,3 +137,9 @@ jobs:
command: cd website && yarn --no-audit --prefer-offline
- name: Generate TypeDoc
run: node -e "require('./website/scripts/generate-typedoc').generateTypedoc()"
- uses: actions/cache/save@v3
name: Yarn Cache Save
if: "${{ github.ref == 'refs/heads/main' }}"
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
publish_npm:
if: "(github.repository == 'invertase/react-native-firebase') && (github.event_name == 'workflow_dispatch')"
name: 'NPM'
timeout-minutes: 5
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Yarn Install
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
timeout_minutes: 15
retry_wait_seconds: 60
max_attempts: 3
command: yarn --no-audit --prefer-offline
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/tests_e2e_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ jobs:
echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "tempdir=$TMPDIR" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Yarn Cache
- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
Expand All @@ -86,7 +86,7 @@ jobs:
- name: Yarn Install
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
timeout_minutes: 15
retry_wait_seconds: 60
max_attempts: 3
command: DETOX_DISABLE_POSTINSTALL=1 yarn --no-audit --prefer-offline
Expand Down Expand Up @@ -237,6 +237,13 @@ jobs:
with:
verbose: true

- uses: actions/cache/save@v3
name: Yarn Cache Save
if: "${{ github.ref == 'refs/heads/main' }}"
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}

- name: Compress Emulator Log
if: always()
run: gzip -9 adb-*.txt
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/tests_e2e_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ jobs:
echo "xcode-version=$(xcodebuild -version|tail -1|cut -f3 -d' ')" >> $GITHUB_OUTPUT
echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Yarn Cache
- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
Expand All @@ -85,7 +85,7 @@ jobs:
- name: Yarn Install
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
timeout_minutes: 15
retry_wait_seconds: 60
max_attempts: 3
command: yarn --no-audit --prefer-offline
Expand Down Expand Up @@ -196,3 +196,10 @@ jobs:
- uses: codecov/codecov-action@v3
with:
verbose: true

- uses: actions/cache/save@v3
name: Yarn Cache Save
if: "${{ github.ref == 'refs/heads/main' }}"
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
12 changes: 9 additions & 3 deletions .github/workflows/tests_jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Yarn Cache
- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Yarn Install
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
timeout_minutes: 15
retry_wait_seconds: 60
max_attempts: 3
command: yarn --no-audit --prefer-offline
Expand All @@ -60,3 +60,9 @@ jobs:
- uses: codecov/codecov-action@v3
with:
verbose: true
- uses: actions/cache/save@v3
name: Yarn Cache Save
if: "${{ github.ref == 'refs/heads/main' }}"
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}

0 comments on commit 2847d33

Please sign in to comment.