Skip to content

Commit

Permalink
dump
Browse files Browse the repository at this point in the history
  • Loading branch information
1ilsang committed May 5, 2024
1 parent 595a753 commit d387a89
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 82 deletions.
53 changes: 53 additions & 0 deletions .github/actions/playwright-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: playwright-install

runs:
using: composite

steps:
# - name: Get playwright version
# shell: bash
# run: |
# echo "PLAYWRIGHT_VERSION=$(node -e "process.stdout.write(require('@playwright/test/package.json').version)")" >> $GITHUB_OUTPUT
# id: playwright-version

# - name: Cache action
# shell: bash
# uses: actions/cache@v3
# id: playwright-cache
# with:
# key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}
# path: ${{ github.workspace }}/ms-playwright

# https://github.com/microsoft/playwright/issues/7249#issuecomment-1385567519
- name: Store Playwright's Version
shell: bash
run: |
PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//')
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- name: Cache Playwright Browsers for Playwright's Version
shell: bash
id: cache-playwright-browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}

- name: Setup Playwright
shell: bash
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: pnpm e2e:install

# - name: ♻️ Restore nextjs-app related caches
# uses: actions/cache@v4
# with:
# path: |
# ${{ github.workspace }}/.next/cache
# ${{ github.workspace }}/.cache
# ${{ github.workspace }}/**/tsconfig.tsbuildinfo
# key: ${{ runner.os }}-nextjs-cache-${{ hashFiles('yarn.lock') }}

- name: Build post
shell: bash
run: pnpm e2e:build
33 changes: 33 additions & 0 deletions .github/actions/pnpm-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: pnpm-install

runs:
using: composite

steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Install pnpm
uses: pnpm/action-setup@v3
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@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install
30 changes: 30 additions & 0 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: code

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: 🌱 Install pnpm
uses: ./.github/actions/pnpm-install

- name: 🏁 Lint
run: pnpm lint

build-export:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: 🌱 Install pnpm
uses: ./.github/actions/pnpm-install

- name: 🏗 Build-export
run: pnpm deploy-blog
16 changes: 5 additions & 11 deletions .github/workflows/playwright.yml → .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Playwright
name: e2e

on:
push:
Expand All @@ -15,18 +15,12 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Install dependencies
run: npm install -g pnpm && pnpm install

- name: Install Playwright Browsers
run: pnpm e2e:install
- name: 🌱 Install pnpm
uses: ./.github/actions/pnpm-install

- name: Build post
run: pnpm e2e:build
- name: 🪛 Install playwright
uses: ./.github/actions/playwright-install

- name: Run Playwright tests
run: pnpm e2e
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/pr-test.yml

This file was deleted.

53 changes: 0 additions & 53 deletions .github/workflows/resuable.yml

This file was deleted.

1 change: 1 addition & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default defineConfig({
},

/* Configure projects for major browsers */
// TODO: workflow_call에 따른 세분화 가능할지?
projects: [
{
name: 'desktop',
Expand Down

0 comments on commit d387a89

Please sign in to comment.