Add workflow to check licenses (#226) #457
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.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/ |