Skip to content

Commit

Permalink
fix import and usage of pre_test_setup/action.yml template within acc…
Browse files Browse the repository at this point in the history
…eptance tests
  • Loading branch information
ichim-david committed Jun 23, 2024
1 parent 542491d commit 2ffdf2e
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 47 deletions.
93 changes: 46 additions & 47 deletions .github/actions/pre_test_setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,49 @@
name: pre test Setup

runs:
using: 'composite'

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# node setup
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Enable corepack
run: corepack enable

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Cache Cypress Binary
id: cache-cypress-binary
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: binary-${{ matrix.node-version }}-${{ hashFiles('pnpm-lock.yaml') }}

- run: pnpm i

- name: Install Cypress if not in cache
if: steps.cache-cypress-binary.outputs.cache-hit != 'true'
working-directory: packages/volto
run: make cypress-install
using: "composite"
steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}

- name: Enable corepack
shell: bash
run: corepack enable

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
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 i

- name: Cache Cypress Binary
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: binary-${{ inputs.node-version }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Install Cypress if not in cache
if: steps.cache-cypress-binary.outputs.cache-hit != 'true'
shell: bash
working-directory: packages/volto
run: make cypress-install

inputs:
node-version:
description: 'Node.js version'
required: true
46 changes: 46 additions & 0 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:

- name: Pretest-Setup
uses: ./.github/actions/pre_test_setup
with:
node-version: ${{ matrix.node-version }}

- name: Cypress acceptance tests
uses: cypress-io/github-action@v6
Expand Down Expand Up @@ -57,8 +59,12 @@ jobs:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4

- name: Pretest-Setup
uses: ./.github/actions/pre_test_setup
with:
node-version: ${{ matrix.node-version }}

- name: Cypress acceptance tests
uses: cypress-io/github-action@v6
Expand Down Expand Up @@ -101,8 +107,12 @@ jobs:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4

- name: Pretest-Setup
uses: ./.github/actions/pre_test_setup
with:
node-version: ${{ matrix.node-version }}

- name: Cypress acceptance tests
uses: cypress-io/github-action@v6
Expand Down Expand Up @@ -145,8 +155,12 @@ jobs:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4

- name: Pretest-Setup
uses: ./.github/actions/pre_test_setup
with:
node-version: ${{ matrix.node-version }}

- name: Cypress acceptance tests
uses: cypress-io/github-action@v6
Expand Down Expand Up @@ -189,8 +203,12 @@ jobs:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4

- name: Pretest-Setup
uses: ./.github/actions/pre_test_setup
with:
node-version: ${{ matrix.node-version }}

- name: Cypress acceptance tests
uses: cypress-io/github-action@v6
Expand Down Expand Up @@ -233,8 +251,12 @@ jobs:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4

- name: Pretest-Setup
uses: ./.github/actions/pre_test_setup
with:
node-version: ${{ matrix.node-version }}

- name: Cypress acceptance tests
uses: cypress-io/github-action@v6
Expand Down Expand Up @@ -276,8 +298,12 @@ jobs:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4

- name: Pretest-Setup
uses: ./.github/actions/pre_test_setup
with:
node-version: ${{ matrix.node-version }}

- name: Cypress acceptance tests
uses: cypress-io/github-action@v6
Expand Down Expand Up @@ -320,8 +346,12 @@ jobs:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4

- name: Pretest-Setup
uses: ./.github/actions/pre_test_setup
with:
node-version: ${{ matrix.node-version }}

- name: Cypress Coresandbox Acceptance tests
uses: cypress-io/github-action@v6
Expand Down Expand Up @@ -432,8 +462,12 @@ jobs:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4

- name: Pretest-Setup
uses: ./.github/actions/pre_test_setup
with:
node-version: ${{ matrix.node-version }}

- name: Cypress acceptance tests
uses: cypress-io/github-action@v6
Expand Down Expand Up @@ -477,8 +511,12 @@ jobs:
node-version: [18.x]
# python-version: [3.7]
steps:
- uses: actions/checkout@v4

- name: Pretest-Setup
uses: ./.github/actions/pre_test_setup
with:
node-version: ${{ matrix.node-version }}

# # python setup (temporary, while p.a.iterate changes are in a PR)
# - name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -687,8 +725,12 @@ jobs:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4

- name: Pretest-Setup
uses: ./.github/actions/pre_test_setup
with:
node-version: ${{ matrix.node-version }}

- name: Cypress acceptance tests
uses: cypress-io/github-action@v6
Expand Down Expand Up @@ -733,8 +775,12 @@ jobs:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4

- name: Pretest-Setup
uses: ./.github/actions/pre_test_setup
with:
node-version: ${{ matrix.node-version }}

- name: Cypress acceptance tests
uses: cypress-io/github-action@v6
Expand Down

0 comments on commit 2ffdf2e

Please sign in to comment.