Run e2e tests during release workflow #312
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Tests on Pull Request | ||
Check failure on line 1 in .github/workflows/test-on-pr.yml
|
||
on: | ||
pull_request: | ||
branches: | ||
- main # or the branch you want to target | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
run_install: false | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: "pnpm" | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Type check | ||
run: pnpm run check:ci | ||
- name: Run tests | ||
env: | ||
APP_TOKEN: test-token | ||
SALEOR_API_URL: http://test.example.com | ||
LOG_LEVEL: error | ||
run: pnpm test | ||
- name: Run CLI end-to-end tests | ||
if: ${{ secrets.CONFIGURATOR_E2E_SALEOR_TOKEN != '' }} | ||
env: | ||
CONFIGURATOR_E2E_SALEOR_TOKEN: ${{ secrets.CONFIGURATOR_E2E_SALEOR_TOKEN }} | ||
CONFIGURATOR_E2E_SALEOR_URL: ${{ secrets.CONFIGURATOR_E2E_SALEOR_URL || 'https://sandbox-a.staging.saleor.cloud/graphql/' }} | ||
run: pnpm test:e2e:ci |