Skip to content

Commit

Permalink
squash - workflows adjusted to new in-repo yarn berry cache location
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehardy committed Oct 24, 2023
1 parent 9dcd674 commit 9461112
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 47 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/create_test_patches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,11 @@ jobs:
with:
node-version: 18.17.1

- name: Set workflow variables
id: workflow-variables
run: echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1

Expand All @@ -59,7 +55,7 @@ jobs:
timeout_minutes: 15
retry_wait_seconds: 60
max_attempts: 3
command: DETOX_DISABLE_POSTINSTALL=1 yarn --no-audit --prefer-offline
command: DETOX_DISABLE_POSTINSTALL=1 yarn

- name: Create Patches
run: |
Expand Down Expand Up @@ -105,7 +101,7 @@ jobs:
name: Yarn Cache Save
if: "${{ github.ref == 'refs/heads/main' }}"
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
path: .yarn/cache
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,
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Set workflow variables
id: workflow-variables
run: echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1
- name: Yarn Install
Expand All @@ -40,7 +37,7 @@ jobs:
timeout_minutes: 15
retry_wait_seconds: 30
max_attempts: 3
command: yarn --no-audit --prefer-offline
command: yarn
- name: Lint
run: yarn lint:markdown
- name: Install Dependencies
Expand All @@ -57,5 +54,5 @@ jobs:
name: Yarn Cache Save
if: "${{ github.ref == 'refs/heads/main' }}"
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
29 changes: 10 additions & 19 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,11 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
- name: Set workflow variables
id: workflow-variables
run: echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1
- name: Yarn Install
Expand All @@ -46,7 +43,7 @@ jobs:
timeout_minutes: 15
retry_wait_seconds: 30
max_attempts: 3
command: yarn --no-audit --prefer-offline
command: yarn
- name: Lint
uses: nick-fields/retry@v2
with:
Expand All @@ -58,7 +55,7 @@ jobs:
name: Yarn Cache Save
if: "${{ github.ref == 'refs/heads/main' }}"
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}


Expand All @@ -73,14 +70,11 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Set workflow variables
id: workflow-variables
run: echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1
- name: Yarn Install
Expand All @@ -89,14 +83,14 @@ jobs:
timeout_minutes: 15
retry_wait_seconds: 30
max_attempts: 3
command: yarn --no-audit --prefer-offline
command: yarn
- 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 }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}


Expand All @@ -111,14 +105,11 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Set workflow variables
id: workflow-variables
run: echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-with-website-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-with-website-v1
- name: Yarn Install
Expand All @@ -127,19 +118,19 @@ jobs:
timeout_minutes: 15
retry_wait_seconds: 30
max_attempts: 3
command: yarn --no-audit --prefer-offline
command: yarn
- name: Yarn Install (Website)
uses: nick-fields/retry@v2
with:
timeout_minutes: 3
retry_wait_seconds: 30
max_attempts: 3
command: cd website && yarn --no-audit --prefer-offline
command: cd website && yarn
- 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 }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-with-website-v1-${{ hashFiles('yarn.lock') }}
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
timeout_minutes: 15
retry_wait_seconds: 60
max_attempts: 3
command: yarn --no-audit --prefer-offline
command: yarn
- name: GIT Setup
run: |
git config --global user.name '@Salakar'
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/tests_e2e_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,13 @@ jobs:
id: workflow-variables
run: |
echo "metro-cache=$HOME/.metro" >> $GITHUB_OUTPUT
echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "tempdir=$TMPDIR" >> $GITHUB_OUTPUT
- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1

Expand All @@ -89,7 +88,7 @@ jobs:
timeout_minutes: 15
retry_wait_seconds: 60
max_attempts: 3
command: DETOX_DISABLE_POSTINSTALL=1 yarn --no-audit --prefer-offline
command: DETOX_DISABLE_POSTINSTALL=1 yarn

- name: Cache Firestore Emulator
uses: actions/cache@v3
Expand Down Expand Up @@ -241,7 +240,7 @@ jobs:
name: Yarn Cache Save
if: "${{ github.ref == 'refs/heads/main' }}"
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}

- name: Compress Emulator Log
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/tests_e2e_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@ jobs:
run: |
echo "metro-cache=$HOME/.metro" >> $GITHUB_OUTPUT
echo "xcode-version=$(xcodebuild -version|tail -1|cut -f3 -d' ')" >> $GITHUB_OUTPUT
echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1

Expand All @@ -88,7 +87,7 @@ jobs:
timeout_minutes: 15
retry_wait_seconds: 60
max_attempts: 3
command: yarn --no-audit --prefer-offline
command: yarn

- name: Setup Ruby
uses: ruby/setup-ruby@v1
Expand Down Expand Up @@ -201,5 +200,5 @@ jobs:
name: Yarn Cache Save
if: "${{ github.ref == 'refs/heads/main' }}"
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
9 changes: 3 additions & 6 deletions .github/workflows/tests_jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,11 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18.15.0
- name: Set workflow variables
id: workflow-variables
run: echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache/restore@v3
name: Yarn Cache Restore
id: yarn-cache
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1
- name: Yarn Install
Expand All @@ -54,7 +51,7 @@ jobs:
timeout_minutes: 15
retry_wait_seconds: 60
max_attempts: 3
command: yarn --no-audit --prefer-offline
command: yarn
- name: Jest
run: yarn tests:jest-coverage
- uses: codecov/codecov-action@v3
Expand All @@ -64,5 +61,5 @@ jobs:
name: Yarn Cache Save
if: "${{ github.ref == 'refs/heads/main' }}"
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}

0 comments on commit 9461112

Please sign in to comment.