Skip to content

Try splitting out yarn install #334

Try splitting out yarn install

Try splitting out yarn install #334

Workflow file for this run

name: CI
on: [push]
jobs:
yarn-install:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- name: Cache root and workspace node_modules
uses: actions/cache@v3
with:
# Cache the root node_modules and each workspace node_modules
path: |
node_modules
packages/*/node_modules
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-
${{ runner.os }}-node-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: yarn install --frozen-lockfile
build-and-test:
runs-on: ubuntu-latest
needs: yarn-install
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- name: Cache root and workspace node_modules
uses: actions/cache@v3
with:
path: |
node_modules
packages/*/node_modules
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-
${{ runner.os }}-node-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
# - name: Install Dependencies
# run: yarn install --frozen-lockfile
- name: Build
run: |
yarn workspace ani-cursor build
yarn workspace webamp build
yarn workspace webamp build-library
- name: Lint
run: |
yarn lint
yarn workspace webamp type-check
- name: Run Unit Tests
run: |
touch packages/skin-database/config.js
yarn test
yarn workspace webamp test
- name: Run Integration Tests
run: yarn workspace webamp integration-tests
env:
CI: true
- name: Upload Screenshot Diffs
if: failure()
uses: actions/upload-artifact@v4
with:
name: image_diffs
path: packages/webamp/js/__tests__/__image_snapshots__/__diff_output__/
- name: Generate New Screenshots
if: failure()
run: |
yarn workspace webamp integration-tests -u
- name: Upload New Screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: new_images
path: packages/webamp/js/__tests__/__image_snapshots__/
main-release:
name: Publish to NPM
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.repository == 'captbaritone/webamp'
needs: [build-and-test]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build latest (master) version
if: github.ref == 'refs/heads/master'
run: |
yarn workspace webamp build-library
echo "Setting version to 0.0.0-next-${RELEASE_COMMIT_SHA::7}"
yarn workspace webamp version --new-version 0.0.0-next-${RELEASE_COMMIT_SHA::7} --no-git-tag-version
env:
RELEASE_COMMIT_SHA: ${{ github.sha }}
- name: Build release version
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
run: exit 1 # TODO: Script to update version number in webampLazy.tsx
- name: Publish to npm
working-directory: ./packages/webamp
if: github.ref == 'refs/heads/master' || github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
run: |
npm publish ${TAG}
env:
TAG: ${{ github.ref == 'refs/heads/master' && '--tag=next' || ''}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}