Skip to content

Commit

Permalink
remove pnpm actions and readd yarn cache
Browse files Browse the repository at this point in the history
  • Loading branch information
shlokamin committed Mar 8, 2024
1 parent ee19c4d commit c5a0cc9
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 53 deletions.
51 changes: 32 additions & 19 deletions .github/workflows/app-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ jobs:
- uses: 'actions/setup-node@v3'
with:
node-version: '18.19.0'
- uses: pnpm/action-setup@v3
with:
version: 8
- name: 'install udev'
run: sudo apt-get update && sudo apt-get install libudev-dev
- name: 'set complex environment variables'
Expand All @@ -72,9 +69,17 @@ jobs:
script: |
const { buildComplexEnvVars } = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/utils.js`)
buildComplexEnvVars(core, context)
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.npm-cache/_prebuild
${{ github.workspace }}/.yarn-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: 'setup-js'
run: |
npm config set cache ${{ github.workspace }}/.npm-cache
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
make setup-js
- name: 'test frontend packages'
run: |
Expand Down Expand Up @@ -104,9 +109,6 @@ jobs:
- uses: 'actions/setup-node@v3'
with:
node-version: '18.19.0'
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-python@v4
with:
python-version: '3.10'
Expand All @@ -124,9 +126,17 @@ jobs:
script: |
const { buildComplexEnvVars } = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/utils.js`)
buildComplexEnvVars(core, context)
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.npm-cache/_prebuild
${{ github.workspace }}/.yarn-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: setup-js
run: |
npm config set cache ${{ github.workspace }}/.npm-cache
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
make setup-js
- name: 'test native(er) packages'
run: make test-js-internal tests="app-shell/src app-shell-odd/src discovery-client/src" cov_opts="--coverage=true"
Expand Down Expand Up @@ -170,11 +180,6 @@ jobs:
echo "both develop builds for edge"
echo 'variants=["release", "internal-release"]' >> $GITHUB_OUTPUT
echo 'type=develop' >> $GITHUB_OUTPUT
elif [ "${{ format('{0}', endsWith(github.ref, 'protocol_designer-migrate-webpack-to-vite')) }}" = "true" ] ; then
echo "REMOVE THIS AFTER APP TESTS ARE MIGRATED"
echo "HACK: run release builds for the vite migration branch"
echo 'variants=["release", "internal-release"]' >> $GITHUB_OUTPUT
echo 'type=develop' >> $GITHUB_OUTPUT
elif [ "${{ format('{0}', endsWith(github.ref, 'app-build-internal')) }}" = "true" ] ; then
echo "internal-release builds for app-build-internal suffixes"
echo 'variants=["internal-release"]' >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -237,9 +242,6 @@ jobs:
- uses: 'actions/setup-node@v3'
with:
node-version: '18.19.0'
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-python@v4
with:
python-version: '3.10'
Expand All @@ -257,9 +259,17 @@ jobs:
script: |
const { buildComplexEnvVars } = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/utils.js`)
buildComplexEnvVars(core, context)
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.npm-cache/_prebuild
${{ github.workspace }}/.yarn-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: setup-js
run: |
npm config set cache ${{ github.workspace }}/.npm-cache
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
make setup-js
# build the desktop app and deploy it
- name: 'build ${{matrix.variant}} app for ${{ matrix.os }}'
Expand Down Expand Up @@ -302,9 +312,8 @@ jobs:
deploy-release-app:
name: 'Deploy built app artifacts to S3'
runs-on: 'ubuntu-22.04'
# TODO: readd unit test dependency after tests are converted to vitest
needs:
['build-app', 'determine-build-type']
['js-unit-test', 'backend-unit-test', 'build-app', 'determine-build-type']
if: contains(fromJSON(needs.determine-build-type.outputs.variants), 'release') || contains(fromJSON(needs.determine-build-type.outputs.variants), 'internal-release')
steps:
- name: 'download run app builds'
Expand Down Expand Up @@ -414,9 +423,6 @@ jobs:
cd ./monorepo
git fetch -f origin ${{ github.ref }}:${{ github.ref }}
git checkout ${{ github.ref }}
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: 'actions/setup-node@v3'
with:
node-version: '18.19.0'
Expand All @@ -429,9 +435,16 @@ jobs:
script: |
const { buildComplexEnvVars } = require(`${process.env.GITHUB_WORKSPACE}/monorepo/.github/workflows/utils.js`)
buildComplexEnvVars(core, context)
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.npm-cache/_prebuild
${{ github.workspace }}/.yarn-cache
- name: 'setup-js'
run: |
npm config set cache ${{ github.workspace }}/.npm-cache
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
cd monorepo
make setup-js
- name: 'update internal-releases releases.json'
Expand Down
43 changes: 24 additions & 19 deletions .github/workflows/components-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,20 @@ jobs:
runs-on: 'ubuntu-22.04'
steps:
- uses: 'actions/checkout@v3'
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: 'actions/setup-node@v3'
with:
node-version: '18.19.0'
- name: 'install udev for usb-detection'
run: sudo apt-get update && sudo apt-get install libudev-dev
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.yarn-cache
${{ github.workspace }}/.npm-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
- name: 'setup-js'
run: |
npm config set cache ./.npm-cache
Expand All @@ -64,21 +70,27 @@ jobs:
name: 'build components artifact'
runs-on: 'ubuntu-22.04'
if: github.event_name != 'pull_request'
# TODO IMMEDIATELY: revert change below. doing this so i can test component builds without tests passing
#needs: ['js-unit-test']
needs: ['js-unit-test']
steps:
- uses: 'actions/checkout@v3'
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: 'actions/setup-node@v3'
with:
node-version: '18.19.0'
- name: 'install udev for usb-detection'
run: sudo apt-get update && sudo apt-get install libudev-dev
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.yarn-cache
${{ github.workspace }}/.npm-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
- name: 'setup-js'
run: |
npm config set cache ./.npm-cache
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'build components'
run: make -C components
Expand Down Expand Up @@ -112,8 +124,8 @@ jobs:
name: 'deploy components storybook artifact to S3'
runs-on: 'ubuntu-22.04'
needs:
# TODO IMMEDIATELY: revert change below. doing this so i can test component builds without tests passing
['build-components-storybook', 'determine-build-type']
# TODO IMMEDIATELY: revert change below. doing this so i can test component builds without tests passing
['js-unit-test', build-components-storybook', 'determine-build-type']
if: needs.determine-build-type.outputs.type != 'none'
steps:
- uses: 'actions/checkout@v3'
Expand All @@ -123,9 +135,6 @@ jobs:
run: |
git fetch -f origin ${{ github.ref }}:${{ github.ref }}
git checkout ${{ github.ref }}
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: 'actions/setup-node@v3'
with:
node-version: '18.19.0'
Expand All @@ -152,8 +161,7 @@ jobs:
publish-components:
name: 'publish components package to npm'
runs-on: 'ubuntu-latest'
# TODO IMMEDIATELY: revert change below. doing this so i can test component builds without tests passing
needs: ['determine-build-type']
needs: ['js-unit-test', 'determine-build-type']
if: needs.determine-build-type.outputs.type == 'publish'
steps:
- uses: 'actions/checkout@v3'
Expand All @@ -163,17 +171,14 @@ jobs:
run: |
git fetch -f origin ${{ github.ref }}:${{ github.ref }}
git checkout ${{ github.ref }}
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: 'actions/setup-node@v3'
with:
node-version: '18.19.0'
registry-url: 'https://registry.npmjs.org'
- name: 'setup-js'
run: |
npm config set cache ./.npm-cache
yarn config set cache-folder ./.yarn-cache
yarn config set cache-folder ./.yarn-cache
- name: 'build typescript'
run: make build-ts
- name: 'build library'
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/g-code-testing-lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,17 @@ jobs:
- uses: './.github/actions/python/setup'
with:
project: 'g-code-testing'
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.npm-cache/_prebuild
${{ github.workspace }}/.yarn-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: 'setup-js'
run: |
npm config set cache ${{ github.workspace }}/.npm-cache
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
make setup-js
- name: Lint
run: make -C g-code-testing lint
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/js-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ jobs:
timeout-minutes: 20
steps:
- uses: 'actions/checkout@v3'
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: 'actions/setup-node@v3'
with:
node-version: '18.19.0'
Expand All @@ -58,10 +55,20 @@ jobs:
buildComplexEnvVars(core, context)
- name: 'install libudev for usb-detection'
run: sudo apt-get update && sudo apt-get install libudev-dev
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.yarn-cache
${{ github.workspace }}/.npm-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
- name: 'setup-js'
id: 'setup-js'
run: |
npm config set cache ${{ github.workspace }}/.npm-cache
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
make setup-js
# Use the if to run all the lint checks even of some fail
shell: bash
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/ll-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,19 @@ jobs:
git checkout ${{ github.ref }}
- name: 'install libudev for usb-detection'
run: sudo apt-get update && sudo apt-get install libudev-dev
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.yarn-cache
${{ github.workspace }}/.npm-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
- name: 'setup-js'
run: |
npm config set cache ./.npm-cache
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'run labware library unit tests'
run: make -C labware-library test-cov
Expand Down Expand Up @@ -84,9 +94,19 @@ jobs:
node-version: '18.19.0'
- name: 'install libudev for usb-detection'
run: sudo apt-get update && sudo apt-get install libudev-dev
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.yarn-cache
${{ github.workspace }}/.npm-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
- name: 'setup-js'
run: |
npm config set cache ./.npm-cache
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'test-e2e'
env:
Expand Down Expand Up @@ -114,9 +134,19 @@ jobs:
node-version: '18.19.0'
- name: 'install libudev for usb-detection'
run: sudo apt-get update && sudo apt-get install libudev-dev
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.yarn-cache
${{ github.workspace }}/.npm-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
- name: 'setup-js'
run: |
npm config set cache ./.npm-cache
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'build LL'
env:
Expand Down
Loading

0 comments on commit c5a0cc9

Please sign in to comment.