Skip to content

fix(pagaleve): Using settings content domain on localhost tests #778

fix(pagaleve): Using settings content domain on localhost tests

fix(pagaleve): Using settings content domain on localhost tests #778

Workflow file for this run

name: Module and app tests
on:
pull_request:
paths:
- "packages/**"
- "!**/package.json"
- "!packages/storefront/**"
- "!packages/ssr/**"
- "!packages/feeds/**"
- "!packages/passort/**"
- "!packages/i18n/**"
- "!packages/__skeleton/**"
push:
branches:
- main
paths:
- ".github/workflows/test-apps.yml"
- "packages/**"
- "pnpm-lock.yaml"
- "!**/package.json"
- "!packages/storefront/**"
- "!packages/ssr/**"
- "!packages/feeds/**"
- "!packages/passort/**"
- "!packages/i18n/**"
- "!packages/__skeleton/**"
jobs:
test:
runs-on: ubuntu-latest
if: |
!contains(github.event.head_commit.message, '[skip ci]') &&
!contains(github.event.head_commit.author.name, '[bot]')
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: ecomplus/store
path: store
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-paths
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.pnpm-paths.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- shell: bash
run: bash scripts/pre-install.sh && pnpm install --no-frozen-lockfile
- uses: actions/cache@v4
with:
path: |
**/.turbo
**/.cache/turbo
packages/*/lib
packages/apps/*/lib
packages/apps/*/assets/*.min.js
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- shell: bash
env:
ECOM_STORE_ID: ${{ secrets.ECOM_STORE_ID }}
ECOM_AUTHENTICATION_ID: ${{ secrets.ECOM_AUTHENTICATION_ID }}
ECOM_API_KEY: ${{ secrets.ECOM_API_KEY }}
MERCADOPAGO_TOKEN: ${{ secrets.MERCADOPAGO_TOKEN }}
FRENET_TOKEN: ${{ secrets.FRENET_TOKEN }}
GALAXPAY_ID: ${{ secrets.GALAXPAY_ID }}
GALAXPAY_HASH: ${{ secrets.GALAXPAY_HASH }}
run: pnpm build
- name: Get npm global directories
id: npm-paths
shell: bash
run: |
lib_path=$(npm list -g | head -1)
echo "LIB_PATH=$lib_path" >> $GITHUB_OUTPUT
echo "BIN_PATH=${lib_path/\/lib//bin}" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: npm-g-cache
with:
path: |
${{ steps.npm-paths.outputs.LIB_PATH }}
${{ steps.npm-paths.outputs.BIN_PATH }}
~/.npm-global/bin
key: ${{ runner.os }}-npm-globals-firebase-tools-13.28.0
- if: steps.npm-g-cache.outputs.cache-hit != 'true'
shell: bash
run: npm install -g [email protected]
- name: Initialize Firebase emulators
shell: bash
working-directory: store
env:
ECOM_STORE_ID: ${{ secrets.ECOM_STORE_ID }}
ECOM_AUTHENTICATION_ID: ${{ secrets.ECOM_AUTHENTICATION_ID }}
ECOM_API_KEY: ${{ secrets.ECOM_API_KEY }}
MERCADOPAGO_TOKEN: ${{ secrets.MERCADOPAGO_TOKEN }}
run: |
printf "ECOM_AUTHENTICATION_ID=$ECOM_AUTHENTICATION_ID
ECOM_API_KEY=$ECOM_API_KEY
ECOM_STORE_ID=$ECOM_STORE_ID
" > functions/.env
npx cloudcommerce prepare
firebase --project=ecom2-demo emulators:start --only functions,hosting &
- name: Run tests
shell: bash
env:
ECOM_STORE_ID: ${{ secrets.ECOM_STORE_ID }}
ECOM_AUTHENTICATION_ID: ${{ secrets.ECOM_AUTHENTICATION_ID }}
ECOM_API_KEY: ${{ secrets.ECOM_API_KEY }}
MERCADOPAGO_TOKEN: ${{ secrets.MERCADOPAGO_TOKEN }}
FRENET_TOKEN: ${{ secrets.FRENET_TOKEN }}
GALAXPAY_ID: ${{ secrets.GALAXPAY_ID }}
GALAXPAY_HASH: ${{ secrets.GALAXPAY_HASH }}
run: |
sleep 10
pnpm test:apps