Skip to content

Commit

Permalink
chore: try reusable flow
Browse files Browse the repository at this point in the history
  • Loading branch information
PupoSDC committed May 15, 2023
1 parent b3870a6 commit a3000cd
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 76 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/checkout-and-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Checkout and Install

env:
QUESTION_BANK_PROVIDER: local
NEXT_PUBLIC_BASE_URL: https://www.chair-flight.com/

jobs:
checkout_and_install:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

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

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

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
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
run: pnpm install
41 changes: 3 additions & 38 deletions .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,12 @@ env:
NEXT_PUBLIC_BASE_URL: https://www.chair-flight.com/

jobs:
checkout_and_install:
runs-on: ubuntu-latest

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

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

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

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
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
run: pnpm install

run_checks:
runs-on: ubuntu-latest
needs: [checkout_and_install]

steps:
- name: Setup
uses: ./.github/workflows/checkout-and-install.yml

- name: Run Prettier
run: pnpm prettier

Expand Down
41 changes: 3 additions & 38 deletions .github/workflows/e2e-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,11 @@ name: E2E Check
on: deployment_status

jobs:
checkout_and_install:
e2e_checks:
runs-on: ubuntu-latest

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

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

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

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Setup
uses: ./.github/workflows/checkout-and-install.yml

- name: Install dependencies
run: pnpm install

run_e2e_tests:
runs-on: ubuntu-latest
needs: [checkout_and_install]

steps:
- name: Run e2e
run: pnpm e2e --basePath= ${{ github.event.deployment_status.target_url }}

0 comments on commit a3000cd

Please sign in to comment.