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

build: Yarn Berry Playground #3447

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ const settings = {
'plugin/',
'publish/',
'resources/lib/',
'.pnp.cjs',
'.pnp.loader.mjs',
'.yarn/',
],
'parserOptions': {
'ecmaVersion': 2020,
Expand Down
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@
# Set the language for these files to jsonc to ensure GitHub doesn't show the comments as errors
.vscode/*.json linguist-language=jsonc
tsconfig*.json linguist-language=jsonc

# Set yarn file as binary so that github would not show diff when updating it
.yarn/cache/**/*.zip binary
.yarn/sdks/** binary
.yarn/releases/** binary
.yarn/plugins/** binary

.pnp.cjs -diff
.pnp.loader.mjs -diff
16 changes: 4 additions & 12 deletions .github/workflows/build-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,14 @@ jobs:
with:
node-version: '14'

- name: Cache Dependencies
id: cache
uses: actions/cache@v2
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}

- name: Install Node Dependencies
if: steps.cache.outputs.cache-hit != 'true'
- name: Extract Yarn Cache
run: |
npm ci --ignore-scripts
yarn install

- name: Fetch dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
npm run fetch-deps
yarn run fetch-deps

- name: Set up msbuild
uses: microsoft/[email protected]
Expand All @@ -81,7 +73,7 @@ jobs:

- name: Build JavaScript UI Module Bundles
run: |
npm run build
yarn run build

- name: Generate artifact
shell: bash
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/css-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,14 @@ jobs:
with:
node-version: '14'

- name: Cache Dependencies
id: cache
uses: actions/cache@v2
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}

- name: Add Custom Problem Matcher
run: |
echo "::add-matcher::.github/matchers/${{ github.job }}.json"

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
- name: Extract Yarn Cache
run: |
npm ci --ignore-scripts
yarn install

- name: npm run stylelint
- name: yarn run stylelint
run: |
npm run stylelint
yarn run stylelint
18 changes: 5 additions & 13 deletions .github/workflows/javascript-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,14 @@ jobs:
with:
node-version: '14'

- name: Cache Dependencies
id: cache
uses: actions/cache@v2
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
- name: Extract Yarn Cache
run: |
npm ci --ignore-scripts
yarn install

- name: TypeScript checking
run: |
npm run tsc-no-emit
yarn run tsc-no-emit

- name: npm run lint
- name: yarn run lint
run: |
npm run lint
yarn run lint
11 changes: 2 additions & 9 deletions .github/workflows/labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,9 @@ jobs:
with:
node-version: '14'

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install Dependencies
- name: Extract Yarn Cache
run: |
npm ci
yarn install

- name: Run Label Script
run: |
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/lint-pr-title.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,9 @@ jobs:
with:
node-version: '14'

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install Dependencies
- name: Extract Yarn Cache
run: |
npm ci
yarn install

- name: Run Lint Script
run: |
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,14 @@ jobs:
with:
node-version: '14'

- name: Cache Dependencies
id: cache
uses: actions/cache@v2
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}

- name: Add Custom Problem Matcher
run: |
echo "::add-matcher::.github/matchers/${{ github.job }}.json"

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
- name: Extract Yarn Cache
run: |
npm ci --ignore-scripts
yarn install

- name: npm run markdownlint
- name: yarn run markdownlint
run: |
npm run markdownlint
yarn run markdownlint
20 changes: 6 additions & 14 deletions .github/workflows/post-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,14 @@ jobs:
with:
node-version: '14'

- name: Cache Dependencies
id: cache
uses: actions/cache@v2
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
- name: Extract Yarn Cache
run: |
npm ci --ignore-scripts
yarn install

- name: npm run coverage-report
- name: yarn run coverage-report
run: |
npm run coverage-report
yarn run coverage-report

- name: npm run process-triggers
- name: yarn run process-triggers
run: |
npm run process-triggers
yarn run process-triggers
4 changes: 2 additions & 2 deletions .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-

- name: Install Dependencies
- name: Extract pip Cache
run: |
pip install -r requirements.txt

Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-

- name: Install Dependencies
- name: Extract Yarn Cache
run: |
pip install -r requirements.txt

Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,9 @@ jobs:
with:
node-version: '14'

- uses: actions/cache@v2
id: npm-cache
with:
path: ~/.npm
key: modules-${{ hashFiles('package-lock.json') }}

- name: Fetch NPM Dependencies
# TODO: fix cache@v2 to cache node_modules
# if: steps.npm-cache.outputs.cache-hit != 'true'
- name: Extract Yarn Cache
run: |
npm ci --ignore-scripts
yarn install

# Gets the numerical output of the git tag and assigns it to an environment variable
- name: Get Tag Version
Expand All @@ -48,7 +40,7 @@ jobs:
- name: Fetch Dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
npm run fetch-deps
yarn run fetch-deps
shell: bash
- name: Build Cactbot Plugin
shell: cmd
Expand All @@ -57,7 +49,7 @@ jobs:

- name: Build JavaScript UI Module Bundles
run: |
npm run build
yarn run build
- name: Setup Staging Directory
run: |
./util/publish.sh
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,14 @@ jobs:
with:
node-version: '14'

- name: Cache Dependencies
id: cache
uses: actions/cache@v2
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}

- uses: actions/setup-python@v2
with:
python-version: '3.7'

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
- name: Extract Yarn Cache
run: |
npm ci --ignore-scripts
yarn install

- name: npm test
- name: yarn run test
run: |
npm test
yarn run test
16 changes: 5 additions & 11 deletions .github/workflows/update-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,14 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Cache Dependencies
id: cache
uses: actions/cache@v2
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'

- name: Extract Yarn Cache
run: |
npm ci --ignore-scripts
yarn install
- name: Build
run: |
npm run coverage-report
npm run build-gh-pages
yarn run coverage-report
yarn run build-gh-pages
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/update-triggers-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,13 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Cache Dependencies
id: cache
uses: actions/cache@v2
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'

- name: Extract Yarn Cache
run: |
npm ci --ignore-scripts
yarn install
- name: Build
run: |
npm run process-triggers
yarn run process-triggers
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,14 @@ __pycache__
.venv
env/
venv/

package-lock.json

# Yarn berry
.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
Loading