DEL-24 Refunds (#53) #83
This file contains 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: QA | |
on: | |
pull_request: | |
merge_group: | |
push: | |
branches: | |
- canary | |
concurrency: | |
group: tests-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8.14.1 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "pnpm" | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
${{ github.workspace }}/.next/cache | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} | |
restore-keys: | | |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.json') }}- | |
- name: Install dependencies | |
run: pnpm --version && pnpm install --frozen-lockfile | |
- name: Check prettier | |
run: pnpm prettier --check . | |
- name: Generate | |
run: pnpm generate | |
- name: Test | |
run: pnpm test:ci | |
env: | |
# Secrets | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
TEST_SALEOR_APP_TOKEN: ${{ secrets.TEST_SALEOR_APP_TOKEN }} | |
TEST_KLARNA_USERNAME: ${{ secrets.TEST_KLARNA_USERNAME }} | |
TEST_KLARNA_PASSWORD: ${{ secrets.TEST_KLARNA_PASSWORD }} | |
# Variables | |
TEST_SALEOR_API_URL: ${{ vars.TEST_SALEOR_API_URL }} | |
TEST_SALEOR_APP_ID: ${{ vars.TEST_SALEOR_APP_ID }} | |
TEST_SALEOR_JWKS: ${{ vars.TEST_SALEOR_JWKS }} | |
TEST_KLARNA_API_URL: ${{ vars.TEST_KLARNA_API_URL }} # https://api.playground.klarna.com/ | |
APP_API_BASE_URL: https://klarna.saleor.app | |
- name: Dependency cruiser | |
if: ${{ github.event_name != 'push' }} | |
run: pnpm exec dependency-cruiser src | |
- name: Download coverage report from canary | |
if: ${{ github.event_name != 'push' }} | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow_conclusion: success | |
branch: canary | |
event: push | |
name: coverage-artifacts | |
path: coverage-main/ | |
- name: Coverage report | |
if: ${{ github.event_name != 'push' }} | |
uses: ArtiomTr/jest-coverage-report-action@v2.2.5 | |
with: | |
skip-step: all | |
coverage-file: coverage/report.json | |
base-coverage-file: coverage-main/report.json | |
- name: Upload coverage report | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/canary' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-artifacts | |
path: coverage/ |