Skip to content

Working with payloads #99

Working with payloads

Working with payloads #99

Workflow file for this run

# Unique name for this workflow
name: CI on PR
# Definition when the workflow should run
on:
pull_request:
types: [opened, edited, synchronize, reopened]
# # Workflow environment variables
# env:
# # Is the PR base branch a prerelease branch
# IS_PRERELEASE: ${{ startsWith(github.event.pull_request.base.ref, 'prerelease/') || inputs.prerelease }}
# Jobs to be executed
jobs:
format-lint-lwc-tests:
runs-on: ubuntu-latest
steps:
# Checkout the source code
- name: "Checkout source code"
uses: actions/checkout@v3
# Install Volta to enforce proper node and package manager versions
- name: "Install Volta"
uses: volta-cli/action@v4
# Cache node_modules to speed up the process
- name: "Restore node_modules cache"
id: cache-npm
uses: actions/cache@v3
with:
path: node_modules
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-${{ env.cache-name }}-
npm-
# Install npm dependencies for Prettier and Jest
- name: "Install npm dependencies"
if: steps.cache-npm.outputs.cache-hit != 'true'
run: HUSKY=0 npm ci
# - name: Get changed files
# run: |
# CHANGED_FILES=$(git diff --name-only HEAD^ HEAD)
# echo "$CHANGED_FILES" | grep -E "\.(js|jsx|ts|tsx|html|css|json|md|yaml|yml)$" > changed_files.txt
# - name: Run Prettier verification
# run: npm run prettier:verify -- "$(cat changed_files.txt)"
# # Lint LWC
# - name: "Lint Lightning Web Components"
# run: npm run lint
# LWC unit tests
- name: "Unit test Lightning Web Components"
run: npm run test:unit:coverage
# Upload code coverage data
- name: "Upload code coverage for LWC to Codecov.io"
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
with:
flags: LWC