Skip to content

Commit

Permalink
Merge pull request #6 from saitamau-maximum/refactor/ci
Browse files Browse the repository at this point in the history
refactor(ci): #4
  • Loading branch information
a01sa01to authored Jul 11, 2023
2 parents 548c9f4 + b25a055 commit a89c632
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 55 deletions.
38 changes: 10 additions & 28 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,31 @@ on: pull_request
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]

steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 8.6.2

- name: Use Node.js ${{ matrix.node-version }}
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 18
node-version: ${{ matrix.node-version }}
cache: pnpm
registry-url: 'https://npm.pkg.github.com'
scope: '@saitamau-maximum'
always-auth: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

- uses: pnpm/[email protected]
with:
version: 8.6.2

- name: Expose pnpm config(s) through "$GITHUB_OUTPUT"
id: pnpm-config
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache rotation keys
id: cache-rotation
shell: bash
run: |
echo "YEAR_MONTH=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-config.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-
- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile --prefer-offline

- name: format
Expand Down
37 changes: 10 additions & 27 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,30 @@ on: pull_request
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]

steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 8.6.2

- name: Use Node.js ${{ matrix.node-version }}
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 18
node-version: ${{ matrix.node-version }}
cache: pnpm
registry-url: 'https://npm.pkg.github.com'
scope: '@saitamau-maximum'
always-auth: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

- uses: pnpm/[email protected]
with:
version: 8.6.2

- name: Expose pnpm config(s) through "$GITHUB_OUTPUT"
id: pnpm-config
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache rotation keys
id: cache-rotation
shell: bash
run: |
echo "YEAR_MONTH=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-config.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-
- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile --prefer-offline
Expand Down

0 comments on commit a89c632

Please sign in to comment.