Implemented cache and bumped actions

This commit is contained in:
Core 2022-11-05 00:05:28 +00:00
parent de50c1f263
commit 1343cef776
3 changed files with 53 additions and 42 deletions

View file

@ -34,7 +34,7 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: pnpm/action-setup@v2.2.2 - uses: pnpm/action-setup@v2.2.4
with: with:
version: 7 version: 7

View file

@ -23,21 +23,39 @@ jobs:
# Make sure the actual branch is checked out when running on pull requests # Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }} ref: ${{ github.head_ref }}
- uses: pnpm/action-setup@v2.2.2
with:
version: 7
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2 uses: actions/setup-node@v3
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
cache: "pnpm" cache: "pnpm"
- uses: pnpm/action-setup@v2
name: Setup pnpm 🚧
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm store directory ⌨️
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup cache 🔒
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Update lockfile - name: Update lockfile
run: pnpm update run: pnpm update
- name: Commit Updated Lockfile - name: Commit Updated Lockfile
uses: stefanzweifel/git-auto-commit-action@v4.14.1 uses: stefanzweifel/git-auto-commit-action@v4
with: with:
commit_message: "chore: Updated Lockfile" commit_message: "chore: Updated Lockfile"
commit_user_name: "cider-chore[bot]" commit_user_name: "cider-chore[bot]"
@ -64,7 +82,7 @@ jobs:
run: npm run format:write run: npm run format:write
- name: Commit Prettier Code - name: Commit Prettier Code
uses: stefanzweifel/git-auto-commit-action@v4.14.1 uses: stefanzweifel/git-auto-commit-action@v4
with: with:
commit_message: "chore: Prettified Code\n [ci skip]" commit_message: "chore: Prettified Code\n [ci skip]"
commit_user_name: "cider-chore[bot]" commit_user_name: "cider-chore[bot]"
@ -88,31 +106,8 @@ jobs:
run: cp src/i18n/en_US.json src/i18n/source/en_US.json run: cp src/i18n/en_US.json src/i18n/source/en_US.json
- name: Commit Updated Source File - name: Commit Updated Source File
uses: stefanzweifel/git-auto-commit-action@v4.14.1 uses: stefanzweifel/git-auto-commit-action@v4
with: with:
commit_message: "chore: Updated i18n Source\n [ci skip]" commit_message: "chore: Updated i18n Source\n [ci skip]"
commit_user_name: "cider-chore[bot]" commit_user_name: "cider-chore[bot]"
commit_user_email: "cider-chore[bot]@users.noreply.github.com" commit_user_email: "cider-chore[bot]@users.noreply.github.com"
synchronize-with-crowdin:
runs-on: ubuntu-latest
if: ${{ false }} # disable for now
steps:
- name: Checkout
uses: actions/checkout@v3
- name: crowdin action
uses: crowdin/github-action@1.4.13
with:
upload_translations: true
download_translations: false
project_id: ${{ secrets.CROWDIN_PROJECT_ID }}
token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
source: '/src/i18n/source/**.*'
translation: '/src/i18n/%locale_with_underscore%.json'
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

View file

@ -9,24 +9,40 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest] os: [ubuntu-latest]
node: [14] node: [18]
steps: steps:
- name: Checkout 🛎 - name: Checkout 🛎
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Setup pnpm 🚧F
uses: pnpm/action-setup@v2.2.2
with:
version: 7
- name: Setup node env 🏗 - name: Setup node env 🏗
uses: actions/setup-node@v3.4.1 uses: actions/setup-node@v3
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
check-latest: true check-latest: true
cache: 'pnpm' cache: 'pnpm'
- uses: pnpm/action-setup@v2
name: Setup pnpm 🚧
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm store directory ⌨️
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup cache 🔒
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies 👨🏻‍💻 - name: Install dependencies 👨🏻‍💻
run: pnpm install run: pnpm install