generated from saleor/saleor-app-payment-template
-
Notifications
You must be signed in to change notification settings - Fork 181
90 lines (76 loc) · 3.1 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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.12.0
- uses: actions/setup-node@v4
with:
node-version-file: "package.json"
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
if: ${{ github.actor != 'dependabot[bot]' }}
run: pnpm prettier --check .
- name: Generate
run: pnpm generate
- name: Load secret
uses: 1password/load-secrets-action@v1
with:
# Export loaded secrets as environment variables
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
TEST_SALEOR_APP_TOKEN: op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_SALEOR_APP_TOKEN
TEST_SALEOR_APP_ID: op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_SALEOR_APP_ID
TEST_PAYMENT_APP_SECRET_KEY: op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_SECRET_KEY
TEST_PAYMENT_APP_PUBLISHABLE_KEY: op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_PUBLISHABLE_KEY
TEST_PAYMENT_APP_WEBHOOK_SECRET: op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_WEBHOOK_SECRET
TEST_PAYMENT_APP_WEBHOOK_ID: op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_WEBHOOK_ID
- name: Test
run: pnpm test:ci
- name: Dependency cruiser
if: ${{ github.event_name != 'push' && github.actor != 'dependabot[bot]' }}
run: pnpm exec dependency-cruiser src
- name: Download coverage report from canary
if: ${{ github.event_name != 'push' && github.actor != 'dependabot[bot]' }}
uses: dawidd6/action-download-artifact@v6
with:
workflow_conclusion: success
branch: canary
event: push
name: coverage-artifacts
path: coverage-main/
- name: Coverage report
if: ${{ github.event_name != 'push' && github.actor != 'dependabot[bot]' }}
uses: ArtiomTr/[email protected]
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' && github.actor != 'dependabot[bot]' }}
uses: actions/upload-artifact@v3
with:
name: coverage-artifacts
path: coverage/