Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta: improve CI npm install time #4058

Merged
merged 3 commits into from Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how this can work without centralized remote caching? We get a random new machine on GitHub Actions every time AFAIK so this would never be present?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- 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