Skip to content

Commit

Permalink
ci: Use pnpm for Actions (#5)
Browse files Browse the repository at this point in the history
* ci: Fix CI workflows

* ci: Use pnpm action

* ci: Fix prettier workflow and run prettier
  • Loading branch information
rayokamoto authored Nov 29, 2023
1 parent 72310f2 commit a7c240d
Show file tree
Hide file tree
Showing 11 changed files with 2,709 additions and 916 deletions.
36 changes: 32 additions & 4 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,35 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: pnpm ci
- run: pnpm run build
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm run build
12 changes: 8 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: pnpm ci
- uses: pnpm/action-setup@v2
with:
version: 8
- run: pnpm install
- run: pnpm run lint

prettier:
Expand All @@ -23,6 +25,8 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: pnpm ci
- uses: pnpm/action-setup@v2
with:
version: 8
- run: pnpm install
- run: pnpm run format:check
1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"singleAttributePerLine": false,
"htmlWhitespaceSensitivity": "css",
"embeddedLanguageFormatting": "auto",
"jsdocSingleLineComment": false,
"importOrderSeparation": false,
"importOrder": [
"<THIRD_PARTY_MODULES>",
Expand Down
4 changes: 2 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}
const nextConfig = {};

module.exports = nextConfig
module.exports = nextConfig;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/node": "^20.10.0",
"@types/react": "^18.2.39",
"@types/react-dom": "^18.2.17",
Expand Down
Loading

0 comments on commit a7c240d

Please sign in to comment.