Skip to content

Commit

Permalink
meta: improve CI npm install time (#4058)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Aug 30, 2022
1 parent 647be26 commit 9c5fc02
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 5 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/ci.yml
Expand Up @@ -33,7 +33,10 @@ jobs:
with:
node-version: ${{matrix.node-version}}
- name: Install dependencies
run: corepack yarn install --immutable
run: corepack yarn workspaces focus $(corepack yarn workspaces list --json | jq -r .name | awk '/^@uppy-example/{ next } { if ($0!="uppy.io") print $0 }')
env:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
- name: Run tests
run: corepack yarn run test:unit

Expand All @@ -59,7 +62,8 @@ jobs:
with:
node-version: lts/*
- name: Install dependencies
run: corepack yarn install --immutable
# List all projects that use a custom ESLint config:
run: corepack yarn workspaces focus @uppy/angular @uppy-example/angular @uppy-example/react-native-expo @uppy/react-native @uppy-dev/build
- name: Run linter
run: corepack yarn run lint

Expand All @@ -85,7 +89,7 @@ jobs:
with:
node-version: lts/*
- name: Install dependencies
run: corepack yarn install --immutable
run: corepack yarn workspaces focus @uppy-dev/build
- name: Run linter
run: corepack yarn run lint:markdown

Expand All @@ -111,7 +115,10 @@ jobs:
with:
node-version: lts/*
- name: Install dependencies
run: corepack yarn install --immutable
run: corepack yarn workspaces focus $(corepack yarn workspaces list --json | jq -r .name | awk '/^@uppy-example/{ next } { if ($0!="uppy.io") print $0 }')
env:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
# Need to do a bunch of work to generate the locale typings 🙃
- name: Prepare type declarations
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/companion.yml
Expand Up @@ -32,7 +32,7 @@ jobs:
with:
node-version: ${{matrix.node-version}}
- name: Install dependencies
run: corepack yarn install --immutable
run: corepack yarn workspaces focus @uppy/companion
- name: Run tests
run: corepack yarn run test:companion

13 changes: 13 additions & 0 deletions .github/workflows/e2e.yml
Expand Up @@ -32,12 +32,23 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: create cache folder for Cypress
id: cypress-cache-dir-path
run: echo "::set-output name=dir::$(mktemp -d)"
- uses: actions/cache@v3
with:
path: ${{ steps.cypress-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-cypress
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install dependencies
run: corepack yarn install --immutable
env:
# https://docs.cypress.io/guides/references/advanced-installation#Binary-cache
CYPRESS_CACHE_FOLDER: ${{ steps.cypress-cache-dir-path.outputs.dir }}
- name: Build Uppy packages
run: corepack yarn build
- name: Run end-to-end browser tests
Expand All @@ -55,6 +66,8 @@ jobs:
COMPANION_AWS_BUCKET: ${{secrets.COMPANION_AWS_BUCKET}}
COMPANION_AWS_REGION: ${{secrets.COMPANION_AWS_REGION}}
COMPANION_AWS_DISABLE_ACL: 'true'
# https://docs.cypress.io/guides/references/advanced-installation#Binary-cache
CYPRESS_CACHE_FOLDER: ${{ steps.cypress-cache-dir-path.outputs.dir }}
- name: Upload videos in case of failure
uses: actions/upload-artifact@v3
if: failure()
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/manual-cdn.yml
Expand Up @@ -30,6 +30,9 @@ jobs:
node-version: lts/*
- name: Install dependencies
run: corepack yarn install --immutable
env:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
- name: Build before publishing
run: corepack yarn run build
- name: Upload `${{ github.event.inputs.name }}` to CDN
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release-candidate.yml
Expand Up @@ -35,6 +35,9 @@ jobs:
node-version: lts/*
- name: Install dependencies
run: corepack yarn install --immutable
env:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
- name: Bump candidate packages version
run: corepack yarn version apply --all --json | jq -s > releases.json
- name: Prepare changelog
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Expand Up @@ -30,6 +30,9 @@ jobs:
node-version: lts/*
- name: Install dependencies
run: corepack yarn install --immutable
env:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
- name: Get CHANGELOG diff
run: git --no-pager diff HEAD^ -- CHANGELOG.md | awk '{ if( substr($0,0,1) == "+" && $1 != "+##" && $1 != "+Released:" && $1 != "+++" ) { print substr($0,2) } }' > CHANGELOG.diff.md
- name: Copy README for `uppy` package
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/website.yml
Expand Up @@ -28,6 +28,9 @@ jobs:
node-version: lts/*
- name: Install dependencies
run: corepack yarn install --immutable
env:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
- name: Build Uppy
run: corepack yarn run build
- name: Build website
Expand Down

0 comments on commit 9c5fc02

Please sign in to comment.