Fragment component tests #2966
Workflow file for this run
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: Testing and Linting π§ͺπ | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [18.x] | |
steps: | |
- name: Checkout π | |
uses: actions/[email protected] | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install π§ | |
run: yarn install | |
- name: Build π§ | |
run: yarn build | |
env: | |
NEXT_PUBLIC_API_MOCKING: enabled | |
AEM_GRAPHQL_ENDPOINT: ${{ secrets.AEM_GRAPHQL_ENDPOINT }} | |
ADOBE_ANALYTICS_URL: ${{ secrets.ADOBE_ANALYTICS_URL }} | |
THANK_YOU_EMAIL: ${{ secrets.THANK_YOU_EMAIL }} | |
CI: true | |
- name: Linting Test π | |
run: yarn lint:test | |
env: | |
CI: true | |
- name: Unit Tests π§ͺ | |
run: yarn test:coverage | |
env: | |
CI: true | |
- name: Cypress end-to-end π§ͺ | |
uses: cypress-io/github-action@v6 | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true # allowing set-env funtion to run (vulnerability https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/) | |
CI: true | |
with: | |
install: false | |
start: yarn start | |
- name: Extract branch name | |
shell: bash | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
id: extract_branch | |
- name: Deploy Coverage Report π | |
uses: JamesIves/[email protected] | |
with: | |
TARGET_FOLDER: ${{ steps.extract_branch.outputs.branch }}/coverage | |
BRANCH: gh-pages # The branch the action should deploy to. | |
FOLDER: coverage # The folder the action should deploy. | |
CLEAN: true # Automatically remove deleted files from the deploy branch | |
- name: Find Comment | |
if: steps.extract_branch.outputs.branch != 'main' | |
uses: peter-evans/find-comment@v1 | |
id: fc | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'github-actions[bot]' | |
body-includes: | | |
Coverage Report Link for Branch | |
https://dts-stn.github.io/${{ github.event.pull_request.base.repo.name }}/${{ steps.extract_branch.outputs.branch }}/coverage/lcov-report | |
- name: Create or update comment # comment in pull request storybooks link | |
if: steps.extract_branch.outputs.branch != 'main' | |
uses: peter-evans/create-or-update-comment@v1 | |
with: | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
Coverage Report Link for Branch | |
https://dts-stn.github.io/${{ github.event.pull_request.base.repo.name }}/${{ steps.extract_branch.outputs.branch }}/coverage/lcov-report | |
edit-mode: replace |